Fix monetary sensor compatibility
Validate / syntax (push) Canceled after 0s

This commit is contained in:
git
2026-09-27 18:49:08 +10:00
parent 17a51c75b3
commit dc7c300884
2 changed files with 4 additions and 3 deletions
+2 -3
View File
@@ -6,13 +6,12 @@ from typing import Any
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity, SensorStateClass
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CURRENCY_AUSTRALIAN_DOLLAR
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN
from .const import CURRENCY_CODE, DOMAIN
from .coordinator import UpCoordinator
@@ -24,7 +23,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry, async_add_e
class UpBalanceSensor(CoordinatorEntity[UpCoordinator], SensorEntity):
_attr_device_class = SensorDeviceClass.MONETARY
_attr_state_class = SensorStateClass.TOTAL
_attr_native_unit_of_measurement = CURRENCY_AUSTRALIAN_DOLLAR
_attr_native_unit_of_measurement = CURRENCY_CODE
_attr_has_entity_name = True
def __init__(self, coordinator: UpCoordinator, account_id: str) -> None: