Skip to content

Commit

Permalink
Update plugin.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Smanar authored Apr 5, 2019
1 parent 2dcac3c commit a37d33e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self):

def onStart(self):
Domoticz.Debug("onStart called")
#CreateDevice('1111','lights','Window covering device')
#CreateDevice('1111','sensors','ZHAConsumption')

#Check Domoticz IP
if Parameters["Address"] != '127.0.0.1' and Parameters["Address"] != 'localhost':
Expand Down Expand Up @@ -480,7 +480,7 @@ def InitDeconz(self,_Data,First_item):

#Set it to off
kwarg.update({'sValue': 'Off', 'nValue': 0})

#ignore ZHASwitch if vibration sensor
if 'sensitivity' in _Data[i]['config']:
continue
Expand All @@ -498,7 +498,7 @@ def InitDeconz(self,_Data,First_item):
Type = 'Tradfri_remote'
else:
Type = 'Switch_Generic'

self.Devices[IEEE]['model'] = Type

#Special device
Expand Down Expand Up @@ -638,6 +638,12 @@ def WebSocketConnexion(self,_Data):

#Take care, no uniqueid for groups
IEEE = str(_Data.get('uniqueid',self.GetDeviceIEEE(_Data['id'],_Data['r'])))
if IEEE == 'banned':
Domoticz.Debug("Banned device > " + str(_Data['id']) + ' (' + str(_Data['r']) + ')')
return
if not IEEE:
Domoticz.Error("Websocket error, unknow device > " + str(_Data['id']) + ' (' + str(_Data['r']) + ')')
return
model = self.Devices[IEEE].get('model','')

kwarg = {}
Expand Down

0 comments on commit a37d33e

Please sign in to comment.