Migrate number mode to StrEnum (#60614)

This commit is contained in:
Franck Nijhof 2021-11-30 12:54:06 +01:00 committed by GitHub
parent 1b8eba0afd
commit 7469f083fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 29 deletions

View file

@ -4,8 +4,7 @@ from __future__ import annotations
from typing import cast
from homeassistant import config_entries
from homeassistant.components.number import NumberEntity
from homeassistant.components.number.const import MODE_SLIDER
from homeassistant.components.number import NumberEntity, NumberMode
from homeassistant.const import CONF_NAME
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
@ -47,7 +46,7 @@ class FluxNumber(FluxEntity, CoordinatorEntity, NumberEntity):
_attr_min_value = 1
_attr_max_value = 100
_attr_step = 1
_attr_mode = MODE_SLIDER
_attr_mode = NumberMode.SLIDER
_attr_icon = "mdi:speedometer"
def __init__(