From 2307cac942d4f5b1cef5bdf4a11d9baa5160791c Mon Sep 17 00:00:00 2001 From: jjlawren Date: Thu, 3 Oct 2019 07:26:19 -0500 Subject: [PATCH] Add unique_id to cert_expiry (#27140) * Add unique_id to cert_expiry * Simplify ID --- homeassistant/components/cert_expiry/sensor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/homeassistant/components/cert_expiry/sensor.py b/homeassistant/components/cert_expiry/sensor.py index b564cff7338..2cd5c9abc8e 100644 --- a/homeassistant/components/cert_expiry/sensor.py +++ b/homeassistant/components/cert_expiry/sensor.py @@ -67,6 +67,11 @@ class SSLCertificate(Entity): """Return the name of the sensor.""" return self._name + @property + def unique_id(self): + """Return a unique id for the sensor.""" + return f"{self.server_name}:{self.server_port}" + @property def unit_of_measurement(self): """Return the unit this state is expressed in."""