mirror of
https://github.com/home-assistant/core.git
synced 2026-12-06 13:45:55 -04:00
Remove redundant timestamp checks in MQTT Statestream (#191805)
This commit is contained in:
@@ -66,22 +66,20 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
await mqtt.async_publish(hass, f"{mybase}state", payload, 1, True)
|
||||
|
||||
if publish_timestamps:
|
||||
if new_state.last_updated:
|
||||
await mqtt.async_publish(
|
||||
hass,
|
||||
f"{mybase}last_updated",
|
||||
new_state.last_updated.isoformat(),
|
||||
1,
|
||||
True,
|
||||
)
|
||||
if new_state.last_changed:
|
||||
await mqtt.async_publish(
|
||||
hass,
|
||||
f"{mybase}last_changed",
|
||||
new_state.last_changed.isoformat(),
|
||||
1,
|
||||
True,
|
||||
)
|
||||
await mqtt.async_publish(
|
||||
hass,
|
||||
f"{mybase}last_updated",
|
||||
new_state.last_updated.isoformat(),
|
||||
1,
|
||||
True,
|
||||
)
|
||||
await mqtt.async_publish(
|
||||
hass,
|
||||
f"{mybase}last_changed",
|
||||
new_state.last_changed.isoformat(),
|
||||
1,
|
||||
True,
|
||||
)
|
||||
|
||||
if publish_attributes:
|
||||
for key, val in new_state.attributes.items():
|
||||
|
||||
Reference in New Issue
Block a user