Skip to content

Commit

Permalink
Check updated_date for list and pick first (#22008)
Browse files Browse the repository at this point in the history
  • Loading branch information
GGeezes authored and balloob committed Mar 13, 2019
1 parent 2dcd9d9 commit 1ffc0e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion homeassistant/components/sensor/whois.py
Expand Up @@ -134,7 +134,11 @@ def update(self):
attrs[ATTR_NAME_SERVERS] = ' '.join(response['nameservers'])

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:
attrs[ATTR_REGISTRAR] = response['registrar']
Expand Down

0 comments on commit 1ffc0e3

Please sign in to comment.