Repository navigation
Conversation
The Hilo cloud returns a null serial/identifier for some devices
(observed for the Hilo gateway since ~2026-09-10). HiloDevice.update()
stored None, and the HA integration builds entity unique ids as
f"{device.identifier.lower()}-...", crashing with AttributeError and
taking down the whole hilo sensor platform on every boot.
Coerce None back to the empty string, which is what the cloud used to
return and what existing device registries / unique ids were built
from.
| new_val = val # type: ignore | ||
| if att == "identifier" and new_val is None: | ||
| # The cloud returns a null serial for some devices (observed | ||
| # for the Hilo gateway since ~2026-09-10). Consumers build |
There was a problem hiding this comment.
I assume this date "2026-09-10" is today? Or is it September 10th?
If it is today, I'd strongly recommend always using ISO date format to avoid confusion.
The declared kwargs type excludes None, but the cloud really does send nulls (that is the bug being guarded). Explain and ignore locally on the assignment.
6723bb4 to
6ffa3ec
Compare
|
Hi — the mypy 'unreachable' failure from the first push is fixed (commit 6ffa3ec: explained |
|
Merci for the review over on dvd-dev/hilo#1070 — closing this companion PR as moot. We upgraded to hilo 2026.10.1 (+ python-hilo 2026.9.1) today, so the deprecated REST gateway path (the null dsn source) is no longer used and the guard isn't needed. Our legacy empty-keyed entities didn't migrate automatically; we resolved them with a one-time entity-registry migration onto the historic entity_ids, and everything has been clean since — no duplicates, no orphans. Thanks again for the detailed explanation of the graphql path! |
Problem
Since ~2026-09-10, the Hilo cloud returns a null serial/identifier for the Hilo gateway.
HiloDevice.update()storesidentifier=None, and the HA integration (dvd-dev/hilo) builds every entity unique id asf"{device.identifier.lower()}-...". OnNonethis raisesAttributeError: 'NoneType' object has no attribute 'lower', and because the gateway entities are constructed first, the entire hilo sensor platform fails to set up — every Hilo sensor (challenge, rates, reward, weather, meter power) goes unavailable until the integration is fixed.Observed on our host every boot from 2026-09-10 to 2026-10-09 (14 boots), on python-hilo 2026.3.5 + hilo 2026.8.3:
Fix
Coerce
Noneback to the empty string inHiloDevice.update(). The empty string is what the cloud used to return, so existing device-registry entries and entity unique ids (e.g.-defi_hilo) keep matching.Also checked:
_build_gateway_dictin graphql.py can still emitidentifier: Nonewhen the MAC can't be extracted fromhiloId; with this guard in place that path is safe too.Testing
TestHiloDevice::test_identifier_none_coerces_to_empty_string