mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Add device to cert expiry (#98152)
* Add device to cert expiry * Apply suggestions from code review Co-authored-by: Martin Hjelmare <marhje52@gmail.com> --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
4531dbbe62
commit
e9f9c7799a
@ -14,6 +14,8 @@ from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
||||
from homeassistant.const import CONF_HOST, CONF_PORT, EVENT_HOMEASSISTANT_START
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.device_registry import DeviceEntryType
|
||||
from homeassistant.helpers.entity import DeviceInfo
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.event import async_call_later
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
@ -99,6 +101,11 @@ class SSLCertificateTimestamp(CertExpiryEntity, SensorEntity):
|
||||
super().__init__(coordinator)
|
||||
self._attr_name = f"Cert Expiry Timestamp ({coordinator.name})"
|
||||
self._attr_unique_id = f"{coordinator.host}:{coordinator.port}-timestamp"
|
||||
self._attr_device_info = DeviceInfo(
|
||||
identifiers={(DOMAIN, f"{coordinator.host}:{coordinator.port}")},
|
||||
name=coordinator.name,
|
||||
entry_type=DeviceEntryType.SERVICE,
|
||||
)
|
||||
|
||||
@property
|
||||
def native_value(self) -> datetime | None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user