def is_on(self) -> bool: """Return true if entity is at home.""" try: return bool( SureLocationID(self._state["where"]) == SureLocationID.INSIDE) except (KeyError, TypeError): return False
def device_state_attributes(self) -> Optional[Dict[str, Any]]: """Return the state attributes of the device.""" attributes = None if self._state: attributes = { "since": str( datetime.fromisoformat(self._state["since"]).replace(tzinfo=None) ), "where": SureLocationID(self._state["where"]).name.capitalize(), } return attributes