From d7de3fbfce11619189ab4ded0653f461f41f4a2f Mon Sep 17 00:00:00 2001 From: Dave T <17680170+davet2001@users.noreply.github.com> Date: Wed, 22 Dec 2021 13:29:55 +0000 Subject: [PATCH] Use new enums in picnic tests (#62549) --- tests/components/picnic/test_sensor.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/tests/components/picnic/test_sensor.py b/tests/components/picnic/test_sensor.py index b0d12f1f080..4773206f5cf 100644 --- a/tests/components/picnic/test_sensor.py +++ b/tests/components/picnic/test_sensor.py @@ -10,12 +10,8 @@ import requests from homeassistant import config_entries from homeassistant.components.picnic import const from homeassistant.components.picnic.const import CONF_COUNTRY_CODE, SENSOR_TYPES -from homeassistant.const import ( - CONF_ACCESS_TOKEN, - CURRENCY_EURO, - DEVICE_CLASS_TIMESTAMP, - STATE_UNAVAILABLE, -) +from homeassistant.components.sensor import SensorDeviceClass +from homeassistant.const import CONF_ACCESS_TOKEN, CURRENCY_EURO, STATE_UNAVAILABLE from homeassistant.helpers.device_registry import DeviceEntryType from homeassistant.util import dt @@ -212,44 +208,44 @@ class TestPicnicSensor(unittest.IsolatedAsyncioTestCase): self._assert_sensor( "sensor.picnic_selected_slot_start", "2021-03-03T13:45:00+00:00", - cls=DEVICE_CLASS_TIMESTAMP, + cls=SensorDeviceClass.TIMESTAMP, ) self._assert_sensor( "sensor.picnic_selected_slot_end", "2021-03-03T14:45:00+00:00", - cls=DEVICE_CLASS_TIMESTAMP, + cls=SensorDeviceClass.TIMESTAMP, ) self._assert_sensor( "sensor.picnic_selected_slot_max_order_time", "2021-03-02T21:00:00+00:00", - cls=DEVICE_CLASS_TIMESTAMP, + cls=SensorDeviceClass.TIMESTAMP, ) self._assert_sensor("sensor.picnic_selected_slot_min_order_value", "35.0") self._assert_sensor( "sensor.picnic_last_order_slot_start", "2021-02-26T19:15:00+00:00", - cls=DEVICE_CLASS_TIMESTAMP, + cls=SensorDeviceClass.TIMESTAMP, ) self._assert_sensor( "sensor.picnic_last_order_slot_end", "2021-02-26T20:15:00+00:00", - cls=DEVICE_CLASS_TIMESTAMP, + cls=SensorDeviceClass.TIMESTAMP, ) self._assert_sensor("sensor.picnic_last_order_status", "COMPLETED") self._assert_sensor( "sensor.picnic_last_order_eta_start", "2021-02-26T19:54:00+00:00", - cls=DEVICE_CLASS_TIMESTAMP, + cls=SensorDeviceClass.TIMESTAMP, ) self._assert_sensor( "sensor.picnic_last_order_eta_end", "2021-02-26T20:14:00+00:00", - cls=DEVICE_CLASS_TIMESTAMP, + cls=SensorDeviceClass.TIMESTAMP, ) self._assert_sensor( "sensor.picnic_last_order_delivery_time", "2021-02-26T19:54:05+00:00", - cls=DEVICE_CLASS_TIMESTAMP, + cls=SensorDeviceClass.TIMESTAMP, ) self._assert_sensor( "sensor.picnic_last_order_total_price", "41.33", unit=CURRENCY_EURO