diff --git a/homeassistant/components/monzo/sensor.py b/homeassistant/components/monzo/sensor.py index e67e8490c45e..b0d526f58da5 100644 --- a/homeassistant/components/monzo/sensor.py +++ b/homeassistant/components/monzo/sensor.py @@ -8,6 +8,7 @@ from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, + SensorStateClass, ) from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback @@ -35,6 +36,7 @@ ACCOUNT_SENSORS = ( value_fn=lambda data: data["balance"]["balance"] / 100, device_class=SensorDeviceClass.MONETARY, suggested_display_precision=2, + state_class=SensorStateClass.TOTAL, ), MonzoSensorEntityDescription( key="total_balance", @@ -42,6 +44,7 @@ ACCOUNT_SENSORS = ( value_fn=lambda data: data["balance"]["total_balance"] / 100, device_class=SensorDeviceClass.MONETARY, suggested_display_precision=2, + state_class=SensorStateClass.TOTAL, ), MonzoSensorEntityDescription( key="spend_today", @@ -59,6 +62,7 @@ POT_SENSORS = ( value_fn=lambda data: data["balance"] / 100, device_class=SensorDeviceClass.MONETARY, suggested_display_precision=2, + state_class=SensorStateClass.TOTAL, ), ) diff --git a/tests/components/monzo/snapshots/test_sensor.ambr b/tests/components/monzo/snapshots/test_sensor.ambr index 25aab02720f1..35f5062ca201 100644 --- a/tests/components/monzo/snapshots/test_sensor.ambr +++ b/tests/components/monzo/snapshots/test_sensor.ambr @@ -5,7 +5,9 @@ None, ]), 'area_id': None, - 'capabilities': None, + 'capabilities': dict({ + : , + }), 'config_entry_id': , 'config_subentry_id': , 'device_class': None, @@ -45,6 +47,7 @@ : 'Data provided by Monzo', : 'monetary', : 'Current Account Balance', + : , : 'GBP', }), 'context': , @@ -117,7 +120,9 @@ None, ]), 'area_id': None, - 'capabilities': None, + 'capabilities': dict({ + : , + }), 'config_entry_id': , 'config_subentry_id': , 'device_class': None, @@ -157,6 +162,7 @@ : 'Data provided by Monzo', : 'monetary', : 'Current Account Total balance', + : , : 'GBP', }), 'context': , @@ -173,7 +179,9 @@ None, ]), 'area_id': None, - 'capabilities': None, + 'capabilities': dict({ + : , + }), 'config_entry_id': , 'config_subentry_id': , 'device_class': None, @@ -213,6 +221,7 @@ : 'Data provided by Monzo', : 'monetary', : 'Flex Balance', + : , : 'EUR', }), 'context': , @@ -285,7 +294,9 @@ None, ]), 'area_id': None, - 'capabilities': None, + 'capabilities': dict({ + : , + }), 'config_entry_id': , 'config_subentry_id': , 'device_class': None, @@ -325,6 +336,7 @@ : 'Data provided by Monzo', : 'monetary', : 'Flex Total balance', + : , : 'EUR', }), 'context': , @@ -341,7 +353,9 @@ None, ]), 'area_id': None, - 'capabilities': None, + 'capabilities': dict({ + : , + }), 'config_entry_id': , 'config_subentry_id': , 'device_class': None, @@ -381,6 +395,7 @@ : 'Data provided by Monzo', : 'monetary', : 'Savings Balance', + : , : 'USD', }), 'context': ,