mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 01:07:10 +00:00
Bump pyenphase to 1.23.1 (#136200)
This commit is contained in:
parent
5803d44443
commit
c98df36b75
@ -6,7 +6,7 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/enphase_envoy",
|
"documentation": "https://www.home-assistant.io/integrations/enphase_envoy",
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"loggers": ["pyenphase"],
|
"loggers": ["pyenphase"],
|
||||||
"requirements": ["pyenphase==1.23.0"],
|
"requirements": ["pyenphase==1.23.1"],
|
||||||
"zeroconf": [
|
"zeroconf": [
|
||||||
{
|
{
|
||||||
"type": "_enphase-envoy._tcp.local."
|
"type": "_enphase-envoy._tcp.local."
|
||||||
|
@ -37,7 +37,7 @@ class EnvoyRelaySelectEntityDescription(SelectEntityDescription):
|
|||||||
class EnvoyStorageSettingsSelectEntityDescription(SelectEntityDescription):
|
class EnvoyStorageSettingsSelectEntityDescription(SelectEntityDescription):
|
||||||
"""Describes an Envoy storage settings select entity."""
|
"""Describes an Envoy storage settings select entity."""
|
||||||
|
|
||||||
value_fn: Callable[[EnvoyStorageSettings], str]
|
value_fn: Callable[[EnvoyStorageSettings], str | None]
|
||||||
update_fn: Callable[[Envoy, str], Awaitable[dict[str, Any]]]
|
update_fn: Callable[[Envoy, str], Awaitable[dict[str, Any]]]
|
||||||
|
|
||||||
|
|
||||||
@ -118,7 +118,9 @@ STORAGE_MODE_ENTITY = EnvoyStorageSettingsSelectEntityDescription(
|
|||||||
key="storage_mode",
|
key="storage_mode",
|
||||||
translation_key="storage_mode",
|
translation_key="storage_mode",
|
||||||
options=STORAGE_MODE_OPTIONS,
|
options=STORAGE_MODE_OPTIONS,
|
||||||
value_fn=lambda storage_settings: STORAGE_MODE_MAP[storage_settings.mode],
|
value_fn=lambda storage_settings: (
|
||||||
|
None if not storage_settings.mode else STORAGE_MODE_MAP[storage_settings.mode]
|
||||||
|
),
|
||||||
update_fn=lambda envoy, value: envoy.set_storage_mode(
|
update_fn=lambda envoy, value: envoy.set_storage_mode(
|
||||||
REVERSE_STORAGE_MODE_MAP[value]
|
REVERSE_STORAGE_MODE_MAP[value]
|
||||||
),
|
),
|
||||||
@ -235,7 +237,7 @@ class EnvoyStorageSettingsSelectEntity(EnvoyBaseEntity, SelectEntity):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_option(self) -> str:
|
def current_option(self) -> str | None:
|
||||||
"""Return the state of the select entity."""
|
"""Return the state of the select entity."""
|
||||||
assert self.data.tariff is not None
|
assert self.data.tariff is not None
|
||||||
assert self.data.tariff.storage_settings is not None
|
assert self.data.tariff.storage_settings is not None
|
||||||
|
2
requirements_all.txt
generated
2
requirements_all.txt
generated
@ -1923,7 +1923,7 @@ pyeiscp==0.0.7
|
|||||||
pyemoncms==0.1.1
|
pyemoncms==0.1.1
|
||||||
|
|
||||||
# homeassistant.components.enphase_envoy
|
# homeassistant.components.enphase_envoy
|
||||||
pyenphase==1.23.0
|
pyenphase==1.23.1
|
||||||
|
|
||||||
# homeassistant.components.envisalink
|
# homeassistant.components.envisalink
|
||||||
pyenvisalink==4.7
|
pyenvisalink==4.7
|
||||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@ -1567,7 +1567,7 @@ pyeiscp==0.0.7
|
|||||||
pyemoncms==0.1.1
|
pyemoncms==0.1.1
|
||||||
|
|
||||||
# homeassistant.components.enphase_envoy
|
# homeassistant.components.enphase_envoy
|
||||||
pyenphase==1.23.0
|
pyenphase==1.23.1
|
||||||
|
|
||||||
# homeassistant.components.everlights
|
# homeassistant.components.everlights
|
||||||
pyeverlights==0.1.0
|
pyeverlights==0.1.0
|
||||||
|
@ -226,3 +226,28 @@ async def test_select_storage_modes(
|
|||||||
mock_envoy.set_storage_mode.assert_called_once_with(
|
mock_envoy.set_storage_mode.assert_called_once_with(
|
||||||
REVERSE_STORAGE_MODE_MAP[current_state]
|
REVERSE_STORAGE_MODE_MAP[current_state]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
("mock_envoy", "use_serial"),
|
||||||
|
[
|
||||||
|
("envoy_metered_batt_relay", "enpower_654321"),
|
||||||
|
("envoy_eu_batt", "envoy_1234"),
|
||||||
|
],
|
||||||
|
indirect=["mock_envoy"],
|
||||||
|
)
|
||||||
|
async def test_select_storage_modes_if_none(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
mock_envoy: AsyncMock,
|
||||||
|
config_entry: MockConfigEntry,
|
||||||
|
use_serial: str,
|
||||||
|
) -> None:
|
||||||
|
"""Test select platform entity storage mode when tariff storage_mode is none."""
|
||||||
|
mock_envoy.data.tariff.storage_settings.mode = None
|
||||||
|
with patch("homeassistant.components.enphase_envoy.PLATFORMS", [Platform.SELECT]):
|
||||||
|
await setup_integration(hass, config_entry)
|
||||||
|
|
||||||
|
test_entity = f"{Platform.SELECT}.{use_serial}_storage_mode"
|
||||||
|
|
||||||
|
assert (entity_state := hass.states.get(test_entity))
|
||||||
|
assert entity_state.state == "unknown"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user