Skip to content

Commit

Permalink
fixing when TWO_COMPLEMENT_TST do not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
pipiche38 committed Nov 12, 2023
1 parent 3bda66e commit 7dc5a51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Modules/tuyaTS0601.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ def ts0601_instant_power(self, Devices, nwkid, ep, value):
self.log.logging( "Tuya0601", "Debug", "ts0601_instant_power - Instant Power %s %s %s" % (nwkid, ep, value), nwkid, )
# Given Zigbee 24-bit integer and tuya store in two's complement form
model_name = self.ListOfDevices[ nwkid ]["Model"] if "Model" in self.ListOfDevices[ nwkid ] else None
twocomplement_tst = int( get_deviceconf_parameter_value( self, model_name, "TWO_COMPLEMENT_TST", return_default=0x00 ),16)
twocomplement_val = int( get_deviceconf_parameter_value( self, model_name, "TWO_COMPLEMENT_VAL", return_default=0x00 ),16)
twocomplement_tst = int( get_deviceconf_parameter_value( self, model_name, "TWO_COMPLEMENT_TST", return_default="0" ),16)
twocomplement_val = int( get_deviceconf_parameter_value( self, model_name, "TWO_COMPLEMENT_VAL", return_default="0" ),16)
self.log.logging( "Tuya0601", "Debug", "ts0601_instant_power - Instant Power Two's Complement : %s %s" %( twocomplement_tst, twocomplement_val))

signed_int = int( value )
Expand Down

0 comments on commit 7dc5a51

Please sign in to comment.