Apply suggestions from code review

Updated

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
kbullet 2024-11-21 09:38:05 +07:00 committed by GitHub
parent db1ee1babc
commit 60f505f195
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -297,7 +297,7 @@ CONFIG_SCHEMA = cv.All(
cv.Optional(CONF_QOS, default=0): cv.mqtt_qos,
}
),
cv.Optional(CONF_PUBLISH_NAN_AS_NONE): cv.boolean,
cv.Optional(CONF_PUBLISH_NAN_AS_NONE, default=False): cv.boolean,
}
),
validate_config,
@ -451,7 +451,6 @@ async def to_code(config):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(trigger, [], conf)
if CONF_PUBLISH_NAN_AS_NONE in config:
cg.add(var.set_publish_nan_as_none(config[CONF_PUBLISH_NAN_AS_NONE]))