fix most of the entity creation warning
This commit is contained in:
1 parent
d8756928a5
commit
1d14219b93
1 file changed
+5
@@ -46,6 +46,11 @@ class VirtualSensorBase:
|
|||||||
if super_entity_id != None:
|
if super_entity_id != None:
|
||||||
self.constants['super'] = super_entity_id
|
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:
|
if self_initialize:
|
||||||
self._initialize()
|
self._initialize()
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user