Skip to content

Commit 5223bb1

Browse files
committed
fix dt.as_local timezone resolve
1 parent 06e0ef6 commit 5223bb1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

custom_components/entity_controller/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@
173173
async def async_setup(hass, config):
174174
"""Load graph configurations."""
175175

176-
if(((datetime.now()).astimezone()).tzinfo != dt.as_local(dt.now()).tzinfo):
176+
if(str(((datetime.now()).astimezone()).tzinfo) != str(dt.as_local(dt.now()).tzname())):
177177
_LOGGER.error("Timezones do not Match. Mismatched timezones may cause unintended behaviours.")
178178
_LOGGER.error("System DateTime: %s", ((datetime.now()).astimezone()).tzinfo )
179-
_LOGGER.error("Home Assistant DateTime: %s", dt.as_local(dt.now()).tzinfo )
179+
_LOGGER.error("Home Assistant DateTime: %s", dt.as_local(dt.now()).tzname())
180180

181181
component = EntityComponent(_LOGGER, DOMAIN, hass)
182182

0 commit comments

Comments
 (0)