fix most of the entity creation warning

This commit is contained in:
Pierre committed 2026-10-04 23:10:22 +02:00
1 parent d8756928a5
commit 1d14219b93
1 file changed
+5
+5
View File
@@ -46,6 +46,11 @@ class VirtualSensorBase:
if super_entity_id != None:
self.constants['super'] = super_entity_id
self.entity_existed = self.ad_api.entity_exists(self.sensor_name)
if not self.entity_existed:
self.ad_api.set_state(self.sensor_name, state='unknown',attributes=self.attributes, check_existence=False)
self.entity = self.ad_api.get_entity(self.sensor_name)
if self_initialize:
self._initialize()