Fixing lint output
This commit is contained in:
@@ -91,14 +91,16 @@ class TuyaDevice:
|
|||||||
def set_dps(self, state, dps_index):
|
def set_dps(self, state, dps_index):
|
||||||
"""Changes the value of a DP of the Tuya device, and update the cached status."""
|
"""Changes the value of a DP of the Tuya device, and update the cached status."""
|
||||||
# _LOGGER.info("running def set_dps from TuyaDevice")
|
# _LOGGER.info("running def set_dps from TuyaDevice")
|
||||||
# No need to clear the cache here: let's just update the status of the changed dps as returned by the interface (see 5 lines below)
|
# No need to clear the cache here: let's just update the status of the
|
||||||
|
# changed dps as returned by the interface (see 5 lines below)
|
||||||
# self._cached_status = ""
|
# self._cached_status = ""
|
||||||
# self._cached_status_time = 0
|
# self._cached_status_time = 0
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
try:
|
try:
|
||||||
result = self._interface.set_dps(state, dps_index)
|
result = self._interface.set_dps(state, dps_index)
|
||||||
self._cached_status["dps"].update(result["dps"])
|
self._cached_status["dps"].update(result["dps"])
|
||||||
# NOW WE SHOULD TRIGGER status_updated FOR ALL ENTITIES INVOLVED IN result["dps"] :
|
# NOW WE SHOULD TRIGGER status_updated FOR ALL ENTITIES
|
||||||
|
# INVOLVED IN result["dps"] :
|
||||||
# for dp in result["dps"]:
|
# for dp in result["dps"]:
|
||||||
# have status_updated() called....
|
# have status_updated() called....
|
||||||
return
|
return
|
||||||
|
@@ -253,10 +253,10 @@ class TuyaInterface:
|
|||||||
"""
|
"""
|
||||||
return self.exchange(SET, {str(dps_index): value})
|
return self.exchange(SET, {str(dps_index): value})
|
||||||
|
|
||||||
|
|
||||||
def _decode_received_data(self, data, is_status):
|
def _decode_received_data(self, data, is_status):
|
||||||
"""Return device status."""
|
"""decode the response data received from the device"""
|
||||||
"""is_status may be True (result of a status request) or False (result of a set_dps request)"""
|
# is_status may be True (result of a status request)
|
||||||
|
# or False (result of a set_dps request)
|
||||||
result = data[20:-8] # hard coded offsets
|
result = data[20:-8] # hard coded offsets
|
||||||
if self.dev_type != "type_0a":
|
if self.dev_type != "type_0a":
|
||||||
result = result[15:]
|
result = result[15:]
|
||||||
@@ -308,7 +308,6 @@ class TuyaInterface:
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
def detect_available_dps(self):
|
def detect_available_dps(self):
|
||||||
"""Return which datapoints are supported by the device."""
|
"""Return which datapoints are supported by the device."""
|
||||||
# type_0d devices need a sort of bruteforce querying in order to detect the
|
# type_0d devices need a sort of bruteforce querying in order to detect the
|
||||||
|
Reference in New Issue
Block a user