Skip to content

Commit

Permalink
Improve support for other hubs (e.g. Hi Kumo) (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
iMicknl authored Feb 15, 2021
1 parent 797c52c commit 0612a5b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 4 additions & 2 deletions custom_components/tahoma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
DEFAULT_HUB,
DEFAULT_UPDATE_INTERVAL,
DOMAIN,
HUB_MANUFACTURER,
IGNORED_TAHOMA_TYPES,
SUPPORTED_ENDPOINTS,
TAHOMA_TYPES,
Expand Down Expand Up @@ -194,17 +195,18 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
if isinstance(gateway.sub_type, Enum)
else None
)

gateway_name = (
f"{beautify_name(gateway.type.name)} hub"
if isinstance(gateway.type, Enum)
else None
else gateway.type
)

device_registry.async_get_or_create(
config_entry_id=entry.entry_id,
identifiers={(DOMAIN, gateway.id)},
model=gateway_model,
manufacturer="Somfy",
manufacturer=HUB_MANUFACTURER[hub],
name=gateway_name,
sw_version=gateway.connectivity.protocol_version,
)
Expand Down
10 changes: 10 additions & 0 deletions custom_components/tahoma/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
"Somfy TaHoma": "https://tahomalink.com/enduser-mobile-web/enduserAPI/",
}

HUB_MANUFACTURER = {
"Cozytouch": "Cozytouch",
"eedomus": "eedomus",
"Hi Kumo": "Hitachi",
"Rexel Energeasy Connect": "Rexel",
"Somfy Connexoon IO": "Somfy",
"Somfy Connexoon RTS": "Somfy",
"Somfy TaHoma": "Somfy",
}

MIN_UPDATE_INTERVAL = 30
DEFAULT_UPDATE_INTERVAL = 30

Expand Down
2 changes: 1 addition & 1 deletion custom_components/tahoma/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/tahoma",
"requirements": [
"pyhoma==0.5.7"
"pyhoma==0.5.8"
],
"codeowners": [
"@philklei",
Expand Down
2 changes: 1 addition & 1 deletion requirements.test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ pytest-cov<3.0.0
pytest-homeassistant

# from our manifest.json for our Custom Component
pyhoma==0.5.7
pyhoma==0.5.8

0 comments on commit 0612a5b

Please sign in to comment.