Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bre77 committed Feb 3, 2024
1 parent 9c03472 commit 1f2951e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 4 additions & 4 deletions custom_components/teslemetry/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def has(self, key: str | None = None):
"""Check if a key exists in the coordinator data."""
return (key or self.key) in self.coordinator.data

class TeslemetryVehicleEntity(TeslemetryEntity):
class TeslemetryVehicleEntity(TeslemetryEntity, CoordinatorEntity[TeslemetryVehicleDataCoordinator]):
"""Parent class for Teslemetry Vehicle entities."""

def __init__(
Expand Down Expand Up @@ -96,7 +96,7 @@ async def wake_up_if_asleep(self) -> None:



class TeslemetryEnergyLiveEntity(CoordinatorEntity[TeslemetryEnergySiteLiveCoordinator | TeslemetryEnergySiteInfoCoordinator]):
class TeslemetryEnergyLiveEntity(TeslemetryEntity, CoordinatorEntity[TeslemetryEnergySiteLiveCoordinator]):
"""Parent class for Teslemetry Energy Site Live entities."""

def __init__(
Expand All @@ -115,7 +115,7 @@ def __init__(
name=self.coordinator.data.get("site_name", "Energy Site"),
)

class TeslemetryEnergyInfoEntity(CoordinatorEntity[TeslemetryEnergySiteLiveCoordinator | TeslemetryEnergySiteInfoCoordinator]):
class TeslemetryEnergyInfoEntity(TeslemetryEntity, CoordinatorEntity[TeslemetryEnergySiteInfoCoordinator]):
"""Parent class for Teslemetry Energy Site Info Entities."""

def __init__(
Expand All @@ -135,7 +135,7 @@ def __init__(
)


class TeslemetryWallConnectorEntity(CoordinatorEntity[TeslemetryEnergySiteLiveCoordinator]):
class TeslemetryWallConnectorEntity(TeslemetryEntity, CoordinatorEntity[TeslemetryEnergySiteLiveCoordinator]):
"""Parent class for Teslemetry Wall Connector Entities."""

_attr_has_entity_name = True
Expand Down
10 changes: 8 additions & 2 deletions custom_components/teslemetry/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,16 @@ class TeslemetryNumberEntityDescription(NumberEntityDescription):
),
)

ENERGY_DESCRIPTIONS: tuple[TeslemetryNumberEntityDescription, ...] = (
ENERGY_INFO_DESCRIPTIONS: tuple[TeslemetryNumberEntityDescription, ...] = (
TeslemetryNumberEntityDescription(
key=""
key="backup_reserve_percent"
native_step=PRECISION_WHOLE,
native_min_value=0,
native_max_value=100,
native_unit_of_measurement=PERCENTAGE,
scopes=[Scopes.ENERGY_CMDS]
)
)


async def async_setup_entry(
Expand Down

0 comments on commit 1f2951e

Please sign in to comment.