Fixed device diagnostic corrupting config entry
This commit is contained in:
@@ -70,7 +70,7 @@ async def async_setup(hass: HomeAssistant, config: dict):
|
|||||||
|
|
||||||
async def _handle_reload(service):
|
async def _handle_reload(service):
|
||||||
"""Handle reload service call."""
|
"""Handle reload service call."""
|
||||||
_LOGGER.debug("Service %s.reload called: reloading integration", DOMAIN)
|
_LOGGER.info("Service %s.reload called: reloading integration", DOMAIN)
|
||||||
|
|
||||||
current_entries = hass.config_entries.async_entries(DOMAIN)
|
current_entries = hass.config_entries.async_entries(DOMAIN)
|
||||||
|
|
||||||
|
@@ -43,7 +43,7 @@ async def async_get_device_diagnostics(
|
|||||||
"""Return diagnostics for a device entry."""
|
"""Return diagnostics for a device entry."""
|
||||||
data = {}
|
data = {}
|
||||||
dev_id = list(device.identifiers)[0][1].split("_")[-1]
|
dev_id = list(device.identifiers)[0][1].split("_")[-1]
|
||||||
data[DEVICE_CONFIG] = entry.data[CONF_DEVICES][dev_id]
|
data[DEVICE_CONFIG] = entry.data[CONF_DEVICES][dev_id].copy()
|
||||||
local_key = data[DEVICE_CONFIG][CONF_LOCAL_KEY]
|
local_key = data[DEVICE_CONFIG][CONF_LOCAL_KEY]
|
||||||
data[DEVICE_CONFIG][CONF_LOCAL_KEY] = f"{local_key[0:3]}...{local_key[-3:]}"
|
data[DEVICE_CONFIG][CONF_LOCAL_KEY] = f"{local_key[0:3]}...{local_key[-3:]}"
|
||||||
|
|
||||||
|
@@ -6,4 +6,5 @@ pydocstyle==6.1.1
|
|||||||
cryptography==3.3.2
|
cryptography==3.3.2
|
||||||
pylint==2.8.2
|
pylint==2.8.2
|
||||||
pylint-strict-informational==0.1
|
pylint-strict-informational==0.1
|
||||||
homeassistant==2021.7.1
|
homeassistant==2022.5.1
|
||||||
|
tox==3.25.0
|
||||||
|
2
tox.ini
2
tox.ini
@@ -15,7 +15,7 @@ whitelist_externals =
|
|||||||
true
|
true
|
||||||
setenv =
|
setenv =
|
||||||
LANG=en_US.UTF-8
|
LANG=en_US.UTF-8
|
||||||
PYTHONPATH = {toxinidir}/localtuya-homeassistant
|
PYTHONPATH = {toxinidir}/localtuya
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/requirements_test.txt
|
-r{toxinidir}/requirements_test.txt
|
||||||
commands =
|
commands =
|
||||||
|
Reference in New Issue
Block a user