mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
Fix whois error, check expiration_date for list and pick first (#27930)
This commit is contained in:
parent
e01562ceea
commit
9571f869d1
@ -119,7 +119,10 @@ class WhoisSensor(Entity):
|
|||||||
attrs = {}
|
attrs = {}
|
||||||
|
|
||||||
expiration_date = response["expiration_date"]
|
expiration_date = response["expiration_date"]
|
||||||
attrs[ATTR_EXPIRES] = expiration_date.isoformat()
|
if isinstance(expiration_date, list):
|
||||||
|
attrs[ATTR_EXPIRES] = expiration_date[0].isoformat()
|
||||||
|
else:
|
||||||
|
attrs[ATTR_EXPIRES] = expiration_date.isoformat()
|
||||||
|
|
||||||
if "nameservers" in response:
|
if "nameservers" in response:
|
||||||
attrs[ATTR_NAME_SERVERS] = " ".join(response["nameservers"])
|
attrs[ATTR_NAME_SERVERS] = " ".join(response["nameservers"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user