Home Assistant Unofficial Reference
2024.12.1
entity.py
Go to the documentation of this file.
1
"""Counter for the days until an HTTPS (TLS) certificate will expire."""
2
3
from
__future__
import
annotations
4
5
from
typing
import
Any
6
7
from
homeassistant.helpers.update_coordinator
import
CoordinatorEntity
8
9
from
.coordinator
import
CertExpiryDataUpdateCoordinator
10
11
12
class
CertExpiryEntity
(
CoordinatorEntity
[CertExpiryDataUpdateCoordinator]):
13
"""Defines a base Cert Expiry entity."""
14
15
_attr_has_entity_name =
True
16
17
@property
18
def
extra_state_attributes
(self) -> dict[str, Any]:
19
"""Return additional sensor state attributes."""
20
return
{
21
"is_valid"
: self.coordinator.is_cert_valid,
22
"error"
:
str
(self.coordinator.cert_error),
23
}
homeassistant.components.cert_expiry.entity.CertExpiryEntity
Definition:
entity.py:12
homeassistant.components.cert_expiry.entity.CertExpiryEntity.extra_state_attributes
dict[str, Any] extra_state_attributes(self)
Definition:
entity.py:18
homeassistant.helpers.update_coordinator.CoordinatorEntity
Definition:
update_coordinator.py:568
homeassistant.components.bond.const.str
str
Definition:
const.py:7
homeassistant.helpers.update_coordinator
Definition:
update_coordinator.py:1
core
homeassistant
components
cert_expiry
entity.py
Generated by
1.9.1