Skip to content

Commit ed33788

Browse files
author
Ted Roberts
committed
Fix options UI label for layer prepopulate count (v0.2.28)
1 parent 386a9c3 commit ed33788

4 files changed

Lines changed: 13 additions & 3 deletions

File tree

custom_components/novastar_h/config_flow.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from .discovery import DiscoveredDevice, scan_network
2828

2929
_LOGGER = logging.getLogger(__name__)
30+
_OPT_LAYER_COUNT_UI = "layer_count"
3031

3132

3233
class NovastarConfigFlow(ConfigFlow, domain=DOMAIN):
@@ -330,7 +331,12 @@ async def async_step_init(
330331
) -> FlowResult:
331332
"""Manage the options."""
332333
if user_input is not None:
333-
return self.async_create_entry(title="", data=user_input)
334+
options = dict(user_input)
335+
if _OPT_LAYER_COUNT_UI in options:
336+
options[CONF_LAYER_SELECT_PREPOPULATE_COUNT] = options.pop(
337+
_OPT_LAYER_COUNT_UI
338+
)
339+
return self.async_create_entry(title="", data=options)
334340

335341
# Get current value from options, falling back to data
336342
current_allow_raw = self.config_entry.options.get(
@@ -353,7 +359,7 @@ async def async_step_init(
353359
CONF_ALLOW_RAW_COMMANDS, default=current_allow_raw
354360
): bool,
355361
vol.Optional(
356-
CONF_LAYER_SELECT_PREPOPULATE_COUNT,
362+
_OPT_LAYER_COUNT_UI,
357363
default=current_layer_count,
358364
): vol.All(vol.Coerce(int), vol.Range(min=1, max=16)),
359365
}

custom_components/novastar_h/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
}
2222
],
2323
"zeroconf": ["_novastar._tcp.local."],
24-
"version": "0.2.27"
24+
"version": "0.2.28"
2525
}

custom_components/novastar_h/strings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,12 @@
9191
"title": "Novastar Options",
9292
"data": {
9393
"allow_raw_commands": "Allow Raw Commands",
94+
"layer_count": "Number of Layers to pre-populate for input selection",
9495
"layer_select_prepopulate_count": "Number of Layers to pre-populate for input selection"
9596
},
9697
"data_description": {
9798
"allow_raw_commands": "Enable sending raw API commands via service call",
99+
"layer_count": "How many fixed Layer X Source select entities to create",
98100
"layer_select_prepopulate_count": "How many fixed Layer X Source select entities to create"
99101
}
100102
}

custom_components/novastar_h/translations/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,12 @@
9191
"title": "Novastar Options",
9292
"data": {
9393
"allow_raw_commands": "Allow Raw Commands",
94+
"layer_count": "Number of Layers to pre-populate for input selection",
9495
"layer_select_prepopulate_count": "Number of Layers to pre-populate for input selection"
9596
},
9697
"data_description": {
9798
"allow_raw_commands": "Enable sending raw API commands via service call",
99+
"layer_count": "How many fixed Layer X Source select entities to create",
98100
"layer_select_prepopulate_count": "How many fixed Layer X Source select entities to create"
99101
}
100102
}

0 commit comments

Comments
 (0)