Skip to content

Commit 2109e17

Browse files
committed
changed STATE_RE to match state names with leading digits; see #165
1 parent e436e61 commit 2109e17

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

custom_components/pyscript/trigger.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
_LOGGER = logging.getLogger(LOGGER_PATH + ".trigger")
2525

2626

27-
STATE_RE = re.compile(r"[a-zA-Z]\w*\.[a-zA-Z]\w*(\.(([a-zA-Z]\w*)|\*))?$")
27+
STATE_RE = re.compile(r"\w+\.\w+(\.((\w+)|\*))?$")
2828

2929

3030
def dt_now():

docs/new_features.rst

+1
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,4 @@ Bug fixes since 1.2.1 include:
7272
- An exception is raised when a function is called with unexpected keyword parameters that don't have corresponding
7373
keyword arguments (however, the trigger parameter names are excluded from this check, since trigger functions
7474
are allowed to have any subset of keyword arguments).
75+
- Trigger on any state change now matches state names with leading digits; see #165

0 commit comments

Comments
 (0)