Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
jontofront authored Dec 15, 2023
1 parent b37a51a commit 7de6868
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions custom_components/econet300/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
DOMAIN,
REG_PARAM_DEVICE_CLASS,
REG_PARAM_STATE_CLASS,
REG_PARAM_TRANSLATION_KEY,
SERVICE_COORDINATOR,
SERVICE_API,
REG_PARAM_MAP,
Expand All @@ -35,17 +34,19 @@
@dataclass
class EconetSensorEntityDescription(SensorEntityDescription):
"""Describes Econet sensor entity."""

process_val: Callable[[Any], Any] = lambda x: x


class EconetSensor(SensorEntity):
"""Econet Sensor"""

def __init__(self, entity_description, name, unique_id):
super().__init__(name=name, unique_id=unique_id)
self.entity_description = entity_description
self._attr_native_value = None
@property
def name(self):
"""Return the localized name of the sensor."""
return self.hass.localize(f"econet300.entity.sensor.{self.entity_description.name}")

def _sync_state(self, value):
"""Sync state"""
Expand Down Expand Up @@ -79,8 +80,7 @@ def create_entity_description(key: str):
map_key = REG_PARAM_MAP.get(key, key)
return EconetSensorEntityDescription(
key=key,
name=map_key,
translation_key=REG_PARAM_TRANSLATION_KEY.get(map_key, None),
name=camel_to_snake(map_key),
native_unit_of_measurement=REG_PARAM_UNIT.get(map_key, None),
state_class=REG_PARAM_STATE_CLASS.get(map_key, None),
device_class=REG_PARAM_DEVICE_CLASS.get(map_key, None),
Expand Down

0 comments on commit 7de6868

Please sign in to comment.