schema tweaks

This commit is contained in:
J. Nick Koston
2026-01-21 18:39:08 -10:00
parent d41cf57413
commit 57a52d37a9
2 changed files with 2 additions and 4 deletions
+1 -4
View File
@@ -40,9 +40,8 @@ CONFIG_SCHEMA = cv.All(
cv.Optional(CONF_INITIAL_VALUE): cv.string_strict,
cv.Optional(CONF_RESTORE_VALUE, default=False): cv.boolean,
cv.Optional(CONF_MAX_RESTORE_DATA_LENGTH): cv.int_range(0, 254),
cv.Optional(CONF_UPDATE_INTERVAL): cv.update_interval,
}
).extend(cv.COMPONENT_SCHEMA),
).extend(cv.polling_component_schema("1s")),
validate_update_interval,
)
@@ -78,8 +77,6 @@ async def to_code(config):
value = value.encode()
hash_ = int(hashlib.md5(value).hexdigest()[:8], 16)
cg.add(glob.set_name_hash(hash_))
if CONF_UPDATE_INTERVAL in config:
cg.add(glob.set_update_interval(config[CONF_UPDATE_INTERVAL]))
@automation.register_action(
+1
View File
@@ -10,6 +10,7 @@ globals:
type: int
restore_value: true
initial_value: "0"
update_interval: 5s
- id: glob_float
type: float
restore_value: true