Use read-only options in onkyo options flow (#129929)

This commit is contained in:
epenet 2024-11-06 15:14:59 +01:00 committed by GitHub
parent 29ba140816
commit 7ce74cb5ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -343,7 +343,9 @@ class OnkyoOptionsFlowHandler(OptionsFlow):
return self.async_create_entry(
data={
OPTION_VOLUME_RESOLUTION: self.options[OPTION_VOLUME_RESOLUTION],
OPTION_VOLUME_RESOLUTION: self.config_entry.options[
OPTION_VOLUME_RESOLUTION
],
OPTION_MAX_VOLUME: user_input[OPTION_MAX_VOLUME],
OPTION_INPUT_SOURCES: sources_store,
}
@ -351,7 +353,7 @@ class OnkyoOptionsFlowHandler(OptionsFlow):
schema_dict: dict[Any, Selector] = {}
max_volume: float = self.options[OPTION_MAX_VOLUME]
max_volume: float = self.config_entry.options[OPTION_MAX_VOLUME]
schema_dict[vol.Required(OPTION_MAX_VOLUME, default=max_volume)] = (
NumberSelector(
NumberSelectorConfig(min=1, max=100, mode=NumberSelectorMode.BOX)