fix: improve error handling for null YAML block in VirtualSensorBase

This commit is contained in:
2026-05-24 22:07:36 +02:00
parent 91a48a4604
commit b5145147d7

View File

@@ -25,7 +25,8 @@ class VirtualSensorBase:
self.virtual_sensor_name = sensor_name.split('.')[1]
self.sensor_domain = self.sensor_name.split(".")[0]
assert yaml_block ,f"{self.sensor_name} have a null Yaml block"
if not yaml_block:
self.log_error(f"{self.sensor_name} have a null Yaml block")
self.yaml_block = yaml_block
self.templates_library = templates_library