From 193b255f44662361ebd125e167f930d893370c87 Mon Sep 17 00:00:00 2001 From: RogerSelwyn Date: Sat, 28 Oct 2023 17:02:07 +0100 Subject: [PATCH] maint: Limit data attribute recording for all sensor entities --- custom_components/o365/classes/mailsensor.py | 3 --- custom_components/o365/classes/sensorentity.py | 3 ++- custom_components/o365/classes/teamssensor.py | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/custom_components/o365/classes/mailsensor.py b/custom_components/o365/classes/mailsensor.py index 6b65a08..c8218ca 100644 --- a/custom_components/o365/classes/mailsensor.py +++ b/custom_components/o365/classes/mailsensor.py @@ -8,7 +8,6 @@ from ..const import ( ATTR_ATTRIBUTES, ATTR_AUTOREPLIESSETTINGS, - ATTR_DATA, ATTR_END, ATTR_EXTERNAL_AUDIENCE, ATTR_EXTERNALREPLY, @@ -38,8 +37,6 @@ 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/sensorentity.py b/custom_components/o365/classes/sensorentity.py index 764cf64..f219649 100644 --- a/custom_components/o365/classes/sensorentity.py +++ b/custom_components/o365/classes/sensorentity.py @@ -2,13 +2,14 @@ import voluptuous as vol from homeassistant.helpers.update_coordinator import CoordinatorEntity -from ..const import ATTR_STATE, CONF_PERMISSIONS +from ..const import ATTR_DATA, ATTR_STATE, CONF_PERMISSIONS class O365Sensor(CoordinatorEntity): """O365 generic Sensor class.""" _attr_should_poll = False + _unrecorded_attributes = frozenset((ATTR_DATA,)) def __init__(self, coordinator, config, name, entity_id, entity_type, unique_id): """Initialise the O365 Sensor.""" diff --git a/custom_components/o365/classes/teamssensor.py b/custom_components/o365/classes/teamssensor.py index 694cf1c..8d7aef9 100644 --- a/custom_components/o365/classes/teamssensor.py +++ b/custom_components/o365/classes/teamssensor.py @@ -60,8 +60,6 @@ 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 ):