Skip to content

Commit 3684da7

Browse files
committed
Wire up options flow: expose Users & measurements on the entry
- add async_get_options_flow to RealmeScaleConfigFlow (entry Options was hidden without it) - RealmeScaleOptionsFlow now accepts the config entry from HA Release 0.4.3
1 parent 62e46ef commit 3684da7

3 files changed

Lines changed: 31 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.4.3] - 2026-09-08
11+
12+
### Fixed
13+
- **Entry "Options" menu (Users & measurements) was missing entirely**:
14+
`RealmeScaleConfigFlow` never registered `async_get_options_flow`, so Home
15+
Assistant did not expose the entry's Options at all. The hook is now wired
16+
and `RealmeScaleOptionsFlow` accepts the config entry it is constructed
17+
with. Add / edit / remove users now works from the entry card.
18+
1019
## [0.4.2] - 2026-09-08
1120

1221
### Fixed
@@ -140,7 +149,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
140149
- `realme_scale_measurement` HA event and `realme_scale.reconnect` service.
141150
- Unit tests + hardware-free protocol smoke test (`tests/`).
142151

143-
[Unreleased]: https://github.com/kapilmahawar/realme-scale-ha/compare/v0.4.2...HEAD
152+
[Unreleased]: https://github.com/kapilmahawar/realme-scale-ha/compare/v0.4.3...HEAD
153+
[0.4.3]: https://github.com/kapilmahawar/realme-scale-ha/compare/v0.4.2...v0.4.3
144154
[0.4.2]: https://github.com/kapilmahawar/realme-scale-ha/compare/v0.4.1...v0.4.2
145155
[0.4.1]: https://github.com/kapilmahawar/realme-scale-ha/compare/v0.4.0...v0.4.1
146156
[0.4.0]: https://github.com/kapilmahawar/realme-scale-ha/compare/v0.3.0...v0.4.0

custom_components/realme_scale/config_flow.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424
BluetoothServiceInfoBleak,
2525
async_discovered_service_info,
2626
)
27-
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult, OptionsFlow
27+
from homeassistant.config_entries import (
28+
ConfigEntry,
29+
ConfigFlow,
30+
ConfigFlowResult,
31+
OptionsFlow,
32+
)
2833
from homeassistant.const import CONF_ADDRESS, CONF_NAME
2934
from homeassistant.core import HomeAssistant
3035

@@ -360,6 +365,17 @@ async def async_step_profile(
360365
description_placeholders={"name": self._name},
361366
)
362367

368+
@staticmethod
369+
async def async_get_options_flow(
370+
config_entry: ConfigEntry,
371+
) -> RealmeScaleOptionsFlow:
372+
"""Return the options flow that manages users & measurements.
373+
374+
Without this hook Home Assistant does not expose the entry's
375+
"Options" menu at all.
376+
"""
377+
return RealmeScaleOptionsFlow(config_entry)
378+
363379

364380
# ---------------------------------------------------------------------------
365381
# Options flow (manage users + assignment after install)
@@ -369,8 +385,9 @@ async def async_step_profile(
369385
class RealmeScaleOptionsFlow(OptionsFlow):
370386
"""Menu-driven manager for users and the unknown-measurement queue."""
371387

372-
def __init__(self) -> None:
388+
def __init__(self, config_entry: ConfigEntry) -> None:
373389
"""Initialize the options flow state."""
390+
super().__init__(config_entry)
374391
self._users: list[ScaleUser] | None = None
375392
self._active_user_id: str | None = None
376393
self._tolerance_kg: float = DEFAULT_AUTO_ASSIGN_KG

custom_components/realme_scale/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"issue_tracker": "https://github.com/kapilmahawar/realme-scale-ha/issues",
99
"iot_class": "local_push",
1010
"integration_type": "device",
11-
"version": "0.4.2",
11+
"version": "0.4.3",
1212
"bluetooth": [
1313
{
1414
"service_uuid": "0000a602-0000-1000-8000-00805f9b34fb"

0 commit comments

Comments
 (0)