Skip to content

Commit

Permalink
Send parameters in DeviceAdded report
Browse files Browse the repository at this point in the history
Closes #205
  • Loading branch information
mickeprag committed Nov 13, 2018
1 parent 8cf792b commit a68e732
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions telldus/src/telldus/DeviceManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ def addDevice(self, device):
self.__deviceAdded(device)
if self.live.registered and device.isDevice():
(state, stateValue) = device.state()
parameters = json.dumps(
device.allParameters(),
separators=(',', ':'),
sort_keys=True
)
deviceDict = {
'id': device.id(),
'name': device.name(),
Expand All @@ -100,6 +105,8 @@ def addDevice(self, device):
'stateValue': stateValue,
'protocol': device.protocol(),
'model': device.model(),
'parameters': parameters,
'parametersHash': hashlib.sha1(parameters).hexdigest(),
'transport': device.typeString()
}
msg = LiveMessage("DeviceAdded")
Expand Down

0 comments on commit a68e732

Please sign in to comment.