Skip to content

Commit

Permalink
Merge pull request #129 from Smanar/beta
Browse files Browse the repository at this point in the history
Update version
  • Loading branch information
Smanar authored Mar 15, 2022
2 parents fe64a4f + 172686f commit 14e6619
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 173 deletions.
44 changes: 28 additions & 16 deletions fonctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ def ProcessAllConfig(data):
kwarg.update(ReturnUpdateValue( 'preset' , data['preset'] ) )
if 'lock' in data:
kwarg.update(ReturnUpdateValue( 'lock' , data['lock'] ) )

if 'reachable' in data:
if data['reachable'] == False:
kwarg.update({'TimedOut':1})
Expand Down Expand Up @@ -423,6 +424,10 @@ def ProcessAllState(data,model):
kwarg.update(ReturnUpdateValue('bri', data['bri'], model) )
if 'lift' in data:
kwarg.update(ReturnUpdateValue('lift', data['lift'], model) )
if 'voltage' in data:
kwarg.update(ReturnUpdateValue( 'voltage' , data['voltage'], model) )
if 'current' in data:
kwarg.update(ReturnUpdateValue( 'current' , data['current'], model ) )
#if 'lastupdated' in data:
# kwarg.update(ReturnUpdateValue('lastupdated', data['lastupdated']))

Expand Down Expand Up @@ -641,13 +646,15 @@ def ReturnUpdateValue(command,val,model = None):
else:
kwarg['sValue'] = '3'

if command == 'lightlevel':
if (command == 'lightlevel') or (command == 'lux'):
kwarg['nValue'] = 0
kwarg['sValue'] = str(val)

if command == 'lux':
kwarg['nValue'] = 0
kwarg['sValue'] = str(val)
if command == 'voltage':
kwarg['voltage'] = int(val)

if command == 'current':
kwarg['current'] = int(val)

if command == 'airqualityppb':
kwarg['nValue'] = int(val)
Expand All @@ -656,16 +663,16 @@ def ReturnUpdateValue(command,val,model = None):
if command == 'consumption':
#Wh to Kwh
kwh = round( float(val) * 1, 3)
#Device with power and comsuption, never see yet, so disabled
#if buffercommand.get('power'):
# p = buffercommand['power']
# buffercommand.clear()
# kwarg['nValue'] = 0
# kwarg['sValue'] = str(p) + ';' + str(kwh)
##device with only consumption
#else:
kwarg['nValue'] = 0
kwarg['sValue'] = str(kwh)
#Device with power and comsuption
if buffercommand.get('power'):
p = buffercommand['power']
buffercommand.clear()
kwarg['nValue'] = 0
kwarg['sValue'] = str(p) + ';' + str(kwh)
#device with only consumption
else:
kwarg['nValue'] = 0
kwarg['sValue'] = str(kwh)

if command == 'power':
buffercommand['power'] = val
Expand Down Expand Up @@ -807,7 +814,7 @@ def ButtonConvertion(val,model = 0):

v = 0
Button_Number = 1
e = int(val)
e = int(val or 0)

#Green power device
if e < 1000:
Expand Down Expand Up @@ -920,9 +927,14 @@ def installFE():
except:
pass

#Special part for dockers
if not os.path.exists(templates_path):
templates_path = templates_path.replace("userdata/","")

#Domoticz.Status('File size : ' + str(fs))

if fs == 9007:
if fs == 8967:
Domoticz.Status('Plugin custom pages in date')
return

Domoticz.Status('Starting the installation of plugin custom page (' + str(fs) + ')...')
Expand Down
24 changes: 12 additions & 12 deletions frontend/deCONZ.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ <h2 class="page-header">deCONZ</h2>
<zz-deconz-plugins-table
class="filters"
ng-if="::$ctrl.zigdevs"
zigdevs="$ctrl.zigdevs"
></zz-deconz-plugins-table>
zigdevs="$ctrl.zigdevs">
</zz-deconz-plugins-table>

<section class="bottom-panel">
<button class="btn btn-default pull-left ng-binding" ng-click="$ctrl.autoConfPlugin()">
Expand Down Expand Up @@ -76,15 +76,15 @@ <h3 class="modal-title">{{:: 'Rename Device' | translate }}</h3>
</div>
<div class="modal-footer">
<button type="button"
class="btn btn-primary"
ng-disabled="modalForm.$invalid || $ctrl.isSaving || $ctrl.isUnchanged"
ng-click="$ctrl.renameDevice()">
class="btn btn-primary"
ng-disabled="modalForm.$invalid || $ctrl.isSaving || $ctrl.isUnchanged"
ng-click="$ctrl.renameDevice()">
{{:: 'Rename' | translate }}
</button>

<button type="button"
class="btn btn-default"
ng-click="$dismiss()">
class="btn btn-default"
ng-click="$dismiss()">
{{:: 'Cancel' | translate }}
</button>
</div>
Expand Down Expand Up @@ -116,14 +116,14 @@ <h3 class="modal-title">{{:: 'Configuring Device' | translate }}</h3>

<div class="modal-footer">
<button type="button"
class="btn btn-cancel"
ng-click="$dismiss()">
class="btn btn-cancel"
ng-click="$dismiss()">
{{:: 'Cancel' | translate }}
</button>
<button type="button"
class="btn btn-primary"
ng-disabled="modalForm.$invalid || $ctrl.isUnchanged"
ng-click="$ctrl.configDevice()">
class="btn btn-primary"
ng-disabled="modalForm.$invalid || $ctrl.isUnchanged"
ng-click="$ctrl.configDevice()">
{{:: 'Update' | translate }}
</button>
</div>
Expand Down
7 changes: 3 additions & 4 deletions frontend/deCONZ.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ function(app) {
var deferred = $q.defer();
console.log('Checking DeCONZdsetup')

url = 'https://dresden-light.appspot.com/discover'
url = 'https://phoscon.de/discover'

$http({
method: 'GET',
Expand All @@ -354,9 +354,8 @@ function(app) {
deferred.resolve(response.data)
},function errorCallback(response) {
console.error('Error getting deCONZ Discover data:' + angular.toJson(response, true) )
bootbox.alert('<h2>' + $.t('Likely 503 Over Quota Error') + '</h2><br><p>' +
$.t('This application is temporarily over its serving quota. Please try again tomorrow.') +
'</p><a target="_blank" href="https://dresden-light.appspot.com/discover">https://dresden-light.appspot.com/discover</a>')
bootbox.alert('<h2>' + $.t('Error getting deCONZ Discover data') + '</h2><br>' +
'<a target="_blank" href="https://phoscon.de/discover">https://phoscon.de/discover</a>')
deferred.reject(response)
});

Expand Down
Loading

0 comments on commit 14e6619

Please sign in to comment.