Skip to content

Accept various formats for last_seen/last_timestamp attribute

Compare
Choose a tag to compare
@pnbruckner pnbruckner released this 03 Apr 17:17
· 10 commits to master since this release
c894fd5

Enhance "last seen" attribute processing to allow a datetime string format. Basically, these attributes (last_seen or last_timestamp) can be any one of the following:

  • a naive Python datetime object which is assumed to be in HA's configured time zone
  • an aware Python datetime object in any time zone
  • anything homeassistant.util.dt.utc_from_timestamp will accept (after being converted to a float)
  • anything homeassistant.util.dt.parse_datetime will accept