Skip to content

Commit 83c8ca8

Browse files
committed
chore: bump version to v0.16.19
1 parent 72cfa5e commit 83c8ca8

11 files changed

Lines changed: 658 additions & 9 deletions

File tree

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
padspanHA package version: 0.16.18
1+
padspanHA package version: 0.16.19

custom_components/padspan_ha/__init__.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@
4848
DATA_TRACEBACK,
4949
DATA_TAG_INTEGRATION,
5050
DATA_PANEL_REGISTERED,
51+
DATA_DEVICE_REGISTRY,
5152
)
5253
from .adaptive_store import AdaptiveStore
54+
from .device_registry import DeviceRegistry
5355
from .coordinator import PadSpanCoordinator
5456
from .maps_store import MapsStore
5557
from .model_store import ModelStore
@@ -148,6 +150,20 @@ async def _init_traceback():
148150
await tb_store.async_load()
149151
return (DATA_TRACEBACK, tb_store, f"TracebackStore ready ({len(tb_store.frames)} frames)")
150152

153+
async def _init_device_registry():
154+
dev_reg = DeviceRegistry(hass)
155+
await dev_reg.async_load()
156+
# One-time migration from ObjectStore if device registry is empty
157+
if dev_reg.device_count() == 0:
158+
obj_store = hass.data.get(DOMAIN, {}).get(DATA_OBJECTS)
159+
if obj_store and obj_store.all():
160+
stats = await dev_reg.async_migrate_from_object_store(obj_store)
161+
_LOGGER.info(
162+
"DeviceRegistry migration: %d devices, %d merged, %d skipped",
163+
stats["migrated"], stats["merged"], stats["skipped"],
164+
)
165+
return (DATA_DEVICE_REGISTRY, dev_reg, f"DeviceRegistry ready ({dev_reg.device_count()} devices)")
166+
151167
async def _init_tag():
152168
from .tag_integration import TagIntegration
153169
tag_int = TagIntegration(hass)
@@ -188,6 +204,8 @@ async def _init_tag():
188204
deferred.append(_init_traceback())
189205
if DATA_TAG_INTEGRATION not in hass.data[DOMAIN]:
190206
deferred.append(_init_tag())
207+
if DATA_DEVICE_REGISTRY not in hass.data[DOMAIN]:
208+
deferred.append(_init_device_registry())
191209

192210
if deferred:
193211
results = await asyncio.gather(*deferred)
@@ -478,6 +496,14 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
478496
except Exception as err:
479497
_LOGGER.debug("Object history flush error: %s", err)
480498

499+
# Flush device registry to disk before shutdown
500+
try:
501+
_dev_reg = hass.data.get(DOMAIN, {}).get(DATA_DEVICE_REGISTRY)
502+
if _dev_reg:
503+
await _dev_reg.async_flush_dirty()
504+
except Exception as err:
505+
_LOGGER.debug("DeviceRegistry flush error: %s", err)
506+
481507
# Flush traceback store to disk before shutdown
482508
try:
483509
_dom = hass.data.get(DOMAIN, {})

custom_components/padspan_ha/build_info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# See LICENSE file or https://www.gnu.org/licenses/gpl-3.0.html
55
"""Generated at build time. Used to prove what version is actually installed."""
66

7-
BUILD_VERSION = "0.16.18"
8-
BUILD_ID = "20260322T190509Z"
7+
BUILD_VERSION = "0.16.19"
8+
BUILD_ID = "20260323T162301Z"
99
CHANNEL = "beta"
1010

1111
# Backwards/for convenience

custom_components/padspan_ha/const.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
DOMAIN = "padspan_ha"
2121
NAME = "PadSpan HA"
22-
VERSION = "0.16.18"
22+
VERSION = "0.16.19"
2323

2424
# ── Config-flow option keys ───────────────────────────────────────────────────
2525
CONF_ENABLE_CLOUD = "enable_cloud"
@@ -58,6 +58,7 @@
5858
DATA_TRACEBACK = "traceback"
5959
DATA_TAG_INTEGRATION = "tag_integration"
6060
DATA_FABRIC = "fabric" # positioning fabric (Phase 1 decoupling)
61+
DATA_DEVICE_REGISTRY = "device_registry" # stable device identity registry
6162

6263
# ── HA Storage file keys (.storage/<key>) ─────────────────────────────────────
6364
SETTINGS_STORE_KEY = "padspan_ha.settings"

0 commit comments

Comments
 (0)