mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Check updated_date for list and pick first (#22008)
This commit is contained in:
parent
2dcd9d94c8
commit
1ffc0e3c7c
@ -134,7 +134,11 @@ class WhoisSensor(Entity):
|
|||||||
attrs[ATTR_NAME_SERVERS] = ' '.join(response['nameservers'])
|
attrs[ATTR_NAME_SERVERS] = ' '.join(response['nameservers'])
|
||||||
|
|
||||||
if 'updated_date' in response:
|
if 'updated_date' in response:
|
||||||
attrs[ATTR_UPDATED] = response['updated_date'].isoformat()
|
update_date = response['updated_date']
|
||||||
|
if isinstance(update_date, list):
|
||||||
|
attrs[ATTR_UPDATED] = update_date[0].isoformat()
|
||||||
|
else:
|
||||||
|
attrs[ATTR_UPDATED] = update_date.isoformat()
|
||||||
|
|
||||||
if 'registrar' in response:
|
if 'registrar' in response:
|
||||||
attrs[ATTR_REGISTRAR] = response['registrar']
|
attrs[ATTR_REGISTRAR] = response['registrar']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user