| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -5,6 +5,7 @@ | |
| import base64 | ||
| import logging | ||
| import time | ||
| from collections import OrderedDict | ||
| from collections.abc import Sequence | ||
| from datetime import UTC, datetime, timedelta, tzinfo | ||
| from typing import TYPE_CHECKING, Any, TypeAlias, cast | ||
| Expand Down Expand Up | @@ -66,7 +67,9 @@ def __init__( | |
| self._components_raw: ComponentsRaw | None = None | ||
| self._components: dict[str, int] = {} | ||
| self._state_information: dict[str, Any] = {} | ||
| self._modules: dict[str | ModuleName[Module], SmartModule] = {} | ||
| self._modules: OrderedDict[str | ModuleName[Module], SmartModule] = ( | ||
| OrderedDict() | ||
| ) | ||
| self._parent: SmartDevice | None = None | ||
| self._children: dict[str, SmartDevice] = {} | ||
| self._last_update_time: float | None = None | ||
| Expand Down Expand Up | @@ -445,6 +448,11 @@ async def _initialize_modules(self) -> None: | |
| ): | ||
| self._modules[Thermostat.__name__] = Thermostat(self, "thermostat") | ||
|
|
||
| # We move time to the beginning so other modules can access the | ||
| # time and timezone after update if required. e.g. cleanrecords | ||
| if Time.__name__ in self._modules: | ||
| self._modules.move_to_end(Time.__name__, last=False) | ||
|
Comment thread
Comment on lines
+451
to
+454
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityTbh, this feels rather icky and I would rather like to avoid it, but I suppose it is what it is :-)
Sorry, something went wrong.
All reactions
|
||
|
|
||
| async def _initialize_features(self) -> None: | ||
| """Initialize device features.""" | ||
| self._add_feature( | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThis doesn't work with the timezone dialect so moved this logic to __pre_deserialize__.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.