Skip to content

Commit

Permalink
Use milliseconds as auto_off time format
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed May 9, 2024
1 parent 4680a50 commit 26ec1ad
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/tcs_intercom/binary_sensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
cv.Required(CONF_COMMAND): cv.hex_uint32_t,
cv.Optional(CONF_ICON, default="mdi:doorbell"): cv.icon,
cv.Optional(CONF_NAME, default="Doorbell"): cv.string,
cv.Optional(CONF_AUTO_OFF, default="3s"): cv.positive_time_period_seconds
cv.Optional(CONF_AUTO_OFF, default="3s"): cv.positive_time_period_milliseconds
}
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace esphome
void TCSIntercomBinarySensor::turn_on(uint32_t *timer, uint16_t auto_off)
{
this->publish_state(true);
if (auto_off > 0) *timer = millis() + (auto_off * 1000);
if (auto_off > 0) *timer = millis() + auto_off;
}

void TCSIntercomBinarySensor::turn_off(uint32_t *timer)
Expand Down
2 changes: 1 addition & 1 deletion components/tcs_intercom/tcs_intercom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace esphome

void TCSComponent::loop()
{
// Turn off binary sensor after ... seconds
// Turn off binary sensor after ... milliseconds
uint32_t now_millis = millis();
for (auto &listener : listeners_)
{
Expand Down

0 comments on commit 26ec1ad

Please sign in to comment.