feat: refactor code to add more attributes.

This commit is contained in:
sususweet
2025-09-24 19:57:11 +08:00
parent 39f88365e5
commit 51f0fcc8dc
10 changed files with 299 additions and 223 deletions

View File

@@ -52,18 +52,17 @@ class MideaSensorEntity(MideaEntity, SensorEntity):
device.sn,
device.sn8,
device.model,
entity_key
entity_key,
device=device,
manufacturer=manufacturer,
rationale=rationale,
config=config,
)
self._device = device
self._manufacturer = manufacturer
self._rationale = rationale
self._config = config
@property
def entity_id_suffix(self) -> str:
"""Return the suffix for entity ID."""
return f"sensor_{self._entity_key}"
@property
def native_value(self):
"""Return the native value of the sensor."""