Skip to content
Snippets Groups Projects
Commit c019393e authored by jkerdreu's avatar jkerdreu
Browse files

- renaming function

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@3038 b32b6428-25c9-4566-ad07-03861ab6144f
parent 20ed231f
No related branches found
No related tags found
No related merge requests found
import logging
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
......@@ -44,7 +43,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_remove_config_entry_device(hass: HomeAssistant, entry: ConfigEntry, device_entry: DeviceEntry) -> bool:
"""Remove a config entry from a device."""
bridge = hass.data[DOMAIN][entry.entry_id]
(domain, dev_ident) = utils.extract_device_identifiers(device_entry.identifiers)
(domain, dev_ident) = utils.get_dev_identifiers(device_entry.identifiers)
bridge.ha_remove_device(dev_ident)
return True
......@@ -365,7 +365,7 @@ class Bridge(object):
device_id = event.data.get('device_id')
dr = device_registry.async_get(self.hass)
device_entry = dr.async_get(device_id)
(domain, dev_ident) = utils.extract_device_identifiers(device_entry.identifiers)
(domain, dev_ident) = utils.get_dev_identifiers(device_entry.identifiers)
if domain != DOMAIN:
return
......
......@@ -4,7 +4,7 @@ def str_to_id(value: str) -> str:
return value.translate ({ord(c): "_" for c in "!@#$%^&*()[]{};:,./<>?\|`~-=_+ "})
def extract_device_identifiers(identifiers: str) -> Tuple(str, str):
def get_dev_identifiers(identifiers: str) -> Tuple(str, str):
ident_data = list(identifiers)
domain = ident_data[0][0]
dev_ident = ident_data[0][1]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment