Avoid mutating entity descriptions in tomorrowio (#105975)

This commit is contained in:
Erik Montnemery 2023-12-18 13:57:11 +01:00 committed by GitHub
parent 77c72f2402
commit 94d22c936e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -92,8 +92,9 @@ class TomorrowioSensorEntityDescription(SensorEntityDescription):
)
if self.value_map is not None:
self.device_class = SensorDeviceClass.ENUM
self.options = [item.name.lower() for item in self.value_map]
options = [item.name.lower() for item in self.value_map]
object.__setattr__(self, "device_class", SensorDeviceClass.ENUM)
object.__setattr__(self, "options", options)
# From https://cfpub.epa.gov/ncer_abstracts/index.cfm/fuseaction/display.files/fileID/14285