-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tihomir Heidelberg
committed
Dec 26, 2021
1 parent
ca628ed
commit 440fcdd
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
custom_components/centrometal_boiler/sensors/WebBoilerDeviceTypeSensor.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from typing import List | ||
from homeassistant.components.sensor import SensorEntity | ||
|
||
from .WebBoilerGenericSensor import WebBoilerGenericSensor | ||
from centrometal_web_boiler.WebBoilerDeviceCollection import WebBoilerParameter | ||
|
||
|
||
class WebBoilerDeviceTypeSensor(WebBoilerGenericSensor): | ||
@property | ||
def available(self): | ||
"""Return the availablity of the sensor.""" | ||
return True | ||
|
||
@staticmethod | ||
def create_entities(hass, device) -> List[SensorEntity]: | ||
parameter = WebBoilerParameter() | ||
parameter["name"] = "Device_Type" | ||
parameter["value"] = device["type"] | ||
entities = [] | ||
entities.append( | ||
WebBoilerDeviceTypeSensor( | ||
hass, | ||
device, | ||
["", "mdi:star-circle", None, "Device Type"], | ||
parameter, | ||
) | ||
) | ||
return entities |