From 5b84f05ef1d68a08fc70c3a0f39e7aca30f4879c Mon Sep 17 00:00:00 2001 From: rospogrigio <49229287+rospogrigio@users.noreply.github.com> Date: Thu, 10 Sep 2020 11:46:24 +0200 Subject: [PATCH] Update README.md --- README.md | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/README.md b/README.md index a436c23..52c2370 100644 --- a/README.md +++ b/README.md @@ -111,23 +111,8 @@ Alternatively, you can install localtuya through HACS by adding this repository. ``` 2020-09-04 02:08:26 DEBUG (SyncWorker_26) [custom_components.localtuya.pytuya] decrypted result='{"devId":"REDACTED","dps":{"1":"stop","2":100,"3":40,"5":false,"7":"closing","8":"cancel","9":0,"10":0}}' ``` - -5. Make any necessary edits to the python file(s) for your device(s). For example, if you are using a switch device, you may want to edit switch.py to account for the IDs/DPs that are applciable to your specific device. -``` - #### switch.py snippet - @property - def device_state_attributes(self): - attrs = {} - try: - attrs[ATTR_CURRENT] = "{}".format(self._status['dps']['104']) # Modify to match your device's DPs - attrs[ATTR_CURRENT_CONSUMPTION] = "{}".format(self._status['dps']['105']/10) # Modify to match your device's DPs - attrs[ATTR_VOLTAGE] = "{}".format(self._status['dps']['106']/10) # Modify to match your device's DPs - except KeyError: - pass - return attrs -``` -6. Add any applicable sensors, using the below configuration.yaml entry as a guide: +5. Add any applicable sensors, using the below configuration.yaml entry as a guide: ``` sensor: - platform: template