diff --git a/custom_components/o365/calendar.py b/custom_components/o365/calendar.py index 5c571f1..e2f62b4 100644 --- a/custom_components/o365/calendar.py +++ b/custom_components/o365/calendar.py @@ -205,6 +205,8 @@ async def _async_setup_register_services(hass, update_supported): class O365CalendarEntity(CalendarEntity): """O365 Calendar Event Processing.""" + _unrecorded_attributes = frozenset((ATTR_DATA,)) + def __init__( self, account, diff --git a/custom_components/o365/classes/mailsensor.py b/custom_components/o365/classes/mailsensor.py index 4daea36..6b65a08 100644 --- a/custom_components/o365/classes/mailsensor.py +++ b/custom_components/o365/classes/mailsensor.py @@ -2,11 +2,13 @@ import datetime from homeassistant.components.sensor import SensorEntity + from O365.mailbox import ExternalAudience # pylint: disable=no-name-in-module from ..const import ( ATTR_ATTRIBUTES, ATTR_AUTOREPLIESSETTINGS, + ATTR_DATA, ATTR_END, ATTR_EXTERNAL_AUDIENCE, ATTR_EXTERNALREPLY, @@ -36,6 +38,8 @@ class O365MailSensor(O365Sensor): """O365 generic Mail Sensor class.""" + _unrecorded_attributes = frozenset((ATTR_DATA,)) + def __init__( self, coordinator, config, sensor_conf, mail_folder, name, entity_id, unique_id ): diff --git a/custom_components/o365/classes/teamssensor.py b/custom_components/o365/classes/teamssensor.py index 8d7aef9..694cf1c 100644 --- a/custom_components/o365/classes/teamssensor.py +++ b/custom_components/o365/classes/teamssensor.py @@ -60,6 +60,8 @@ def __init__(self, coordinator, account, name, entity_id, config, unique_id): class O365TeamsChatSensor(O365TeamsSensor, SensorEntity): """O365 Teams Chat sensor processing.""" + _unrecorded_attributes = frozenset((ATTR_DATA,)) + def __init__( self, coordinator, account, name, entity_id, config, unique_id, enable_update ): diff --git a/custom_components/o365/sensor.py b/custom_components/o365/sensor.py index afe07f8..cbdb661 100644 --- a/custom_components/o365/sensor.py +++ b/custom_components/o365/sensor.py @@ -367,7 +367,7 @@ async def _async_email_update(self, entity): attrs.sort(key=itemgetter("received"), reverse=True) self._data[entity.entity_key] = { ATTR_STATE: len(attrs), - ATTR_ATTRIBUTES: {"data": attrs}, + ATTR_ATTRIBUTES: {ATTR_DATA: attrs}, } def _get_attributes(self, data, entity):