From 5bc5afae286608b7b0528c89c60feb55af272edb Mon Sep 17 00:00:00 2001 From: "R. de Veen" Date: Sat, 12 Nov 2022 20:37:52 +0100 Subject: [PATCH] Add ATTR_ICON --- custom_components/o365/sensor.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/custom_components/o365/sensor.py b/custom_components/o365/sensor.py index 1cf14d1..616f4c2 100644 --- a/custom_components/o365/sensor.py +++ b/custom_components/o365/sensor.py @@ -11,6 +11,7 @@ ATTR_CHAT_ID, ATTR_CONTENT, ATTR_FROM_DISPLAY_NAME, + ATTR_ICON, ATTR_IMPORTANCE, ATTR_SUBJECT, ATTR_SUMMARY, @@ -266,6 +267,14 @@ def state(self): """Sensor state.""" return self._state + @property + def extra_state_attributes(self): + """Return entity specific state attributes.""" + attributes = { + ATTR_ICON: "mdi:microsoft-teams", + } + return attributes + async def async_update(self): """Update state.""" data = await self.hass.async_add_executor_job(self._teams.get_my_presence)