mirror of
https://github.com/home-assistant/core.git
synced 2026-09-29 21:19:06 +01:00
Bump momonga to 0.7.0 (#183254)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
d6383e3629
commit
b44de9cbde
@@ -21,10 +21,10 @@ _LOGGER = logging.getLogger(__name__)
|
||||
class BRouteData:
|
||||
"""Class for data of the B Route."""
|
||||
|
||||
instantaneous_current_r_phase: float
|
||||
instantaneous_current_t_phase: float
|
||||
instantaneous_power: float
|
||||
total_consumption: float
|
||||
instantaneous_current_r_phase: float | None
|
||||
instantaneous_current_t_phase: float | None
|
||||
instantaneous_power: float | None
|
||||
total_consumption: float | None
|
||||
|
||||
|
||||
type BRouteConfigEntry = ConfigEntry[BRouteUpdateCoordinator]
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
"momonga.sk_wrapper_logger"
|
||||
],
|
||||
"quality_scale": "bronze",
|
||||
"requirements": ["momonga==0.3.0"]
|
||||
"requirements": ["momonga==0.7.0"]
|
||||
}
|
||||
|
||||
Generated
+1
-1
@@ -1650,7 +1650,7 @@ modbus-connection[tmodbus]==4.12.1
|
||||
moehlenhoff-alpha2==1.4.0
|
||||
|
||||
# homeassistant.components.route_b_smart_meter
|
||||
momonga==0.3.0
|
||||
momonga==0.7.0
|
||||
|
||||
# homeassistant.components.monarch_money
|
||||
monarchmoneycommunity==1.6.0
|
||||
|
||||
@@ -7,7 +7,7 @@ from momonga import MomongaError
|
||||
from syrupy.assertion import SnapshotAssertion
|
||||
|
||||
from homeassistant.components.route_b_smart_meter.const import DEFAULT_SCAN_INTERVAL
|
||||
from homeassistant.const import STATE_UNAVAILABLE
|
||||
from homeassistant.const import STATE_UNAVAILABLE, STATE_UNKNOWN
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_registry import EntityRegistry
|
||||
|
||||
@@ -57,3 +57,34 @@ async def test_route_b_smart_meter_sensor_no_update(
|
||||
|
||||
entity = hass.states.get(entity_id)
|
||||
assert entity.state is STATE_UNAVAILABLE
|
||||
|
||||
|
||||
async def test_route_b_smart_meter_sensor_no_data(
|
||||
hass: HomeAssistant,
|
||||
mock_momonga: Mock,
|
||||
freezer: FrozenDateTimeFactory,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
) -> None:
|
||||
"""Test sensors are unknown when the meter reports no data."""
|
||||
entity_prefix = "sensor.route_b_smart_meter_01234567890123456789012345f789_"
|
||||
await hass.config_entries.async_setup(mock_config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
client = mock_momonga.return_value
|
||||
client.get_instantaneous_current.return_value = {
|
||||
"r phase current": None,
|
||||
"t phase current": 2,
|
||||
}
|
||||
client.get_instantaneous_power.return_value = None
|
||||
client.get_measured_cumulative_energy.return_value = None
|
||||
freezer.tick(DEFAULT_SCAN_INTERVAL)
|
||||
async_fire_time_changed(hass)
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
|
||||
for key in (
|
||||
"instantaneous_current_r_phase",
|
||||
"instantaneous_power",
|
||||
"total_consumption",
|
||||
):
|
||||
assert hass.states.get(f"{entity_prefix}{key}").state == STATE_UNKNOWN
|
||||
assert hass.states.get(f"{entity_prefix}instantaneous_current_t_phase").state == "2"
|
||||
|
||||
Reference in New Issue
Block a user