Add unique_id to cert_expiry (#27140)

* Add unique_id to cert_expiry

* Simplify ID
This commit is contained in:
jjlawren 2019-10-03 07:26:19 -05:00 committed by Martin Hjelmare
parent 69bdce768c
commit 2307cac942

View file

@ -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."""