-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor supported hubs/servers and load them from pyhoma #418
Conversation
I should add
as well! |
Where did you find these ones? |
I pulled them from the original Hi Kumo iOS app. |
@tetienne maybe we should have a different approach here, where we change to a different dictionary model with keys. It would be good to be able to change the cosmetic name, without breaking the integration in the future. Any suggestions? |
What about somethink like: endpoints = {
"endpoint_1": ("Tahoma", "https://..."),
"endpoint_2: ("Overkiz", "https://...),
} To the end user we display |
Would it make sense to have them typed? So we don't have to pull them like endpoints[i][0]? I am not sure how to type them easily, but perhaps just like this? And maybe we should just add this to python-tahoma-api finally? @dataclass
class Hub:
"""Class to describe a hub."""
endpoint: str
name: str
manufacturer: str
endpoints = {
"atlantic_cozytouch": Hub(
name="Atlantic Cozytouch",
endpoint="https://ha110-1.overkiz.com/enduser-mobile-web/enduserAPI/",
manufacturer="Atlantic",
),
} |
A Dutch user just verified that he has to use the Europe server with this Connexoon RTS. The new server list is correct thus :-). |
@@ -90,21 +89,50 @@ async def async_setup(hass: HomeAssistant, config: dict): | |||
return True | |||
|
|||
|
|||
async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works like a charm! Doesn't make this PR breaking anymore, and easy to remove for core PR.
2021-08-09 22:41:33 DEBUG (MainThread) [custom_components.tahoma] Migrating from version 1
2021-08-09 22:41:33 INFO (MainThread) [custom_components.tahoma] Migrated Somfy TaHoma to somfy_europe
2021-08-09 22:41:33 INFO (MainThread) [custom_components.tahoma] Migration to version 2 successful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Backported from core PR. Eventually it would be good to maybe rename this to 'manufacturer', since I removed the model names (Tahoma / Connexoon) from the list. Apparently Somfy has server regions, which I identified as Connexoon RTS in the past...