First tox fixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""The LocalTuya integration. """
|
||||
"""The LocalTuya integration."""
|
||||
import asyncio
|
||||
import logging
|
||||
import time
|
||||
|
@@ -10,6 +10,7 @@ import requests
|
||||
|
||||
# Signature algorithm.
|
||||
def calc_sign(msg, key):
|
||||
"""Calculate signature for request."""
|
||||
sign = (
|
||||
hmac.new(
|
||||
msg=bytes(msg, "latin-1"),
|
||||
@@ -36,6 +37,7 @@ class TuyaCloudApi:
|
||||
self._device_list = {}
|
||||
|
||||
def generate_payload(self, method, t, url, headers, body=None):
|
||||
"""Generate signed payload for requests."""
|
||||
payload = self._client_id + self._access_token + t
|
||||
|
||||
payload += method + "\n"
|
||||
|
@@ -218,6 +218,7 @@ class TuyaDevice(pytuya.TuyaListener, pytuya.ContextualLogger):
|
||||
self._connect_task = None
|
||||
|
||||
async def update_local_key(self):
|
||||
"""Retrieve updated local_key from Cloud API and update the config_entry."""
|
||||
dev_id = self._dev_config_entry[CONF_DEVICE_ID]
|
||||
await self._hass.data[DOMAIN][DATA_CLOUD].async_get_devices_list()
|
||||
cloud_devs = self._hass.data[DOMAIN][DATA_CLOUD]._device_list
|
||||
|
@@ -593,6 +593,7 @@ class LocalTuyaOptionsFlowHandler(config_entries.OptionsFlow):
|
||||
return self.async_show_form(step_id="pick_entity_type", data_schema=schema)
|
||||
|
||||
def available_dps_strings(self):
|
||||
"""Return list of DPs use by the device's entities."""
|
||||
available_dps = []
|
||||
used_dps = [str(entity[CONF_ID]) for entity in self.entities]
|
||||
for dp_string in self.dps_strings:
|
||||
|
Reference in New Issue
Block a user