Skip to content

Commit 7224ef3

Browse files
committed
Update __init__.py
Fixes issue introduced in HA 2024.2.0 release where test against YamlObjects types no longer work, which resulted in no configurations loading. Fix was using isinstance() instead.
1 parent f267df8 commit 7224ef3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

custom_components/entity_controller/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from datetime import date, datetime, time, timedelta
2929
from threading import Timer
3030
import pprint
31-
from typing import Optional
31+
from typing import Optional, List
3232

3333
import homeassistant.helpers.config_validation as cv
3434
import voluptuous as vol
@@ -1650,12 +1650,12 @@ def add(self, list, config, key=None):
16501650
else:
16511651
v = config
16521652

1653-
if type(v) is YamlObjects.NodeStrClass:
1654-
self.log.debug("Found string value %s for key %s, now adding to exiting list %s. (Type: %s)", v, key, list, type(v))
1653+
if isinstance(v,str):
1654+
self.log.debug("Found string value %s for key %s, now adding to existing list %s. (Type: %s)", v, key, list, type(v))
16551655
list.append(v)
16561656
return len(v) > 0
1657-
elif type(v) is YamlObjects.NodeListClass:
1658-
self.log.debug("Found list value %s for key %s, now adding to exiting list %s. (Type: %s)", v, key, list, type(v))
1657+
elif isinstance(v, List):
1658+
self.log.debug("Found list value %s for key %s, now adding to existing list %s. (Type: %s)", v, key, list, type(v))
16591659
list.extend(v)
16601660
return len(v) > 0
16611661
elif v == None:

0 commit comments

Comments
 (0)