File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -459,7 +459,8 @@ def ProcessGpioCommand(self, message):
459
459
error = None
460
460
try :
461
461
channel = int (message ['channel' ].replace (cayennemqtt .SYS_GPIO + ':' , '' ))
462
- result = self .sensorsClient .GpioCommand (message ['suffix' ], channel , message ['payload' ])
462
+ suffix = getattr (message , 'suffix' , 'value' )
463
+ result = self .sensorsClient .GpioCommand (suffix , channel , message ['payload' ])
463
464
debug ('ProcessGpioCommand result: {}' .format (result ))
464
465
if result == 'failure' :
465
466
error = 'GPIO command failed'
@@ -476,7 +477,8 @@ def ProcessSensorCommand(self, message):
476
477
channel = None
477
478
if len (sensor_info ) > 1 :
478
479
channel = sensor_info [1 ]
479
- result = self .sensorsClient .SensorCommand (message ['suffix' ], sensor , channel , message ['payload' ])
480
+ suffix = getattr (message , 'suffix' , 'value' )
481
+ result = self .sensorsClient .SensorCommand (suffix , sensor , channel , message ['payload' ])
480
482
debug ('ProcessSensorCommand result: {}' .format (result ))
481
483
if result is False :
482
484
error = 'Sensor command failed'
You can’t perform that action at this time.
0 commit comments