Add attribution to Sense component (#33657)
This commit is contained in:
1 parent
22ae498f3a
commit
d2e70eb967
3 files changed
+21
-2
No files matched your search
@@ -2,12 +2,13 @@
|
||||
import logging
|
||||
|
||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||
from homeassistant.const import DEVICE_CLASS_POWER
|
||||
from homeassistant.const import ATTR_ATTRIBUTION, DEVICE_CLASS_POWER
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity_registry import async_get_registry
|
||||
|
||||
from .const import (
|
||||
ATTRIBUTION,
|
||||
DOMAIN,
|
||||
MDI_ICONS,
|
||||
SENSE_DATA,
|
||||
@@ -100,6 +101,11 @@ class SenseDevice(BinarySensorDevice):
|
||||
"""Return the old not so unique id of the binary sensor."""
|
||||
return self._id
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
"""Return the icon of the binary sensor."""
|
||||
|
||||
Reference in new issue
Block a user