mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Use enums in repetier (#62038)
This commit is contained in:
parent
4983a8f218
commit
18ae4a9420
@ -8,7 +8,7 @@ import logging
|
||||
import pyrepetier
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import SensorEntityDescription
|
||||
from homeassistant.components.sensor import SensorDeviceClass, SensorEntityDescription
|
||||
from homeassistant.const import (
|
||||
CONF_API_KEY,
|
||||
CONF_HOST,
|
||||
@ -16,7 +16,6 @@ from homeassistant.const import (
|
||||
CONF_NAME,
|
||||
CONF_PORT,
|
||||
CONF_SENSORS,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
PERCENTAGE,
|
||||
TEMP_CELSIUS,
|
||||
)
|
||||
@ -143,21 +142,21 @@ SENSOR_TYPES: dict[str, RepetierSensorEntityDescription] = {
|
||||
type="temperature",
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
name="_bed_",
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
),
|
||||
"extruder_temperature": RepetierSensorEntityDescription(
|
||||
key="extruder_temperature",
|
||||
type="temperature",
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
name="_extruder_",
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
),
|
||||
"chamber_temperature": RepetierSensorEntityDescription(
|
||||
key="chamber_temperature",
|
||||
type="temperature",
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
name="_chamber_",
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
),
|
||||
"current_state": RepetierSensorEntityDescription(
|
||||
key="current_state",
|
||||
|
@ -3,8 +3,7 @@ from datetime import datetime
|
||||
import logging
|
||||
import time
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.const import DEVICE_CLASS_TIMESTAMP
|
||||
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
|
||||
@ -149,7 +148,7 @@ class RepetierJobSensor(RepetierSensor):
|
||||
class RepetierJobEndSensor(RepetierSensor):
|
||||
"""Class to create and populate a Repetier Job End timestamp Sensor."""
|
||||
|
||||
_attr_device_class = DEVICE_CLASS_TIMESTAMP
|
||||
_attr_device_class = SensorDeviceClass.TIMESTAMP
|
||||
|
||||
def update(self):
|
||||
"""Update the sensor."""
|
||||
@ -173,7 +172,7 @@ class RepetierJobEndSensor(RepetierSensor):
|
||||
class RepetierJobStartSensor(RepetierSensor):
|
||||
"""Class to create and populate a Repetier Job Start timestamp Sensor."""
|
||||
|
||||
_attr_device_class = DEVICE_CLASS_TIMESTAMP
|
||||
_attr_device_class = SensorDeviceClass.TIMESTAMP
|
||||
|
||||
def update(self):
|
||||
"""Update the sensor."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user