From 029af94d288394dd993ee813a6a6f69ae67f36e4 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 16 Dec 2021 15:13:13 +0100 Subject: [PATCH] Use new enums in mobile_app (#61929) --- homeassistant/components/mobile_app/sensor.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/mobile_app/sensor.py b/homeassistant/components/mobile_app/sensor.py index 0631f8f72aa..c7896da2576 100644 --- a/homeassistant/components/mobile_app/sensor.py +++ b/homeassistant/components/mobile_app/sensor.py @@ -1,13 +1,11 @@ """Sensor platform for mobile_app.""" from __future__ import annotations -from homeassistant.components.sensor import SensorEntity +from homeassistant.components.sensor import SensorDeviceClass, SensorEntity from homeassistant.const import ( CONF_NAME, CONF_UNIQUE_ID, CONF_WEBHOOK_ID, - DEVICE_CLASS_DATE, - DEVICE_CLASS_TIMESTAMP, STATE_UNKNOWN, ) from homeassistant.core import callback @@ -95,12 +93,12 @@ class MobileAppSensor(MobileAppEntity, SensorEntity): if ( self.device_class in ( - DEVICE_CLASS_DATE, - DEVICE_CLASS_TIMESTAMP, + SensorDeviceClass.DATE, + SensorDeviceClass.TIMESTAMP, ) and (timestamp := dt_util.parse_datetime(state)) is not None ): - if self.device_class == DEVICE_CLASS_DATE: + if self.device_class == SensorDeviceClass.DATE: return timestamp.date() return timestamp