Skip to content

Commit

Permalink
refactor: Use HA "temperature" const
Browse files Browse the repository at this point in the history
  • Loading branch information
jcgoette committed Oct 28, 2022
1 parent dbdb8b6 commit 4f3be82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions custom_components/babybuddy/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
CONF_PATH,
CONF_PORT,
CONF_SCAN_INTERVAL,
TEMPERATURE,
UnitOfMass,
UnitOfTemperature,
UnitOfVolume,
Expand All @@ -22,7 +23,6 @@
from .client import BabyBuddyClient
from .const import (
CONF_FEEDING_UNIT,
CONF_TEMPERATURE_UNIT,
CONF_WEIGHT_UNIT,
CONFIG_FLOW_VERSION,
DEFAULT_NAME,
Expand Down Expand Up @@ -159,8 +159,8 @@ async def async_step_init(

options = {
vol.Optional(
CONF_TEMPERATURE_UNIT,
default=self.config_entry.options.get(CONF_TEMPERATURE_UNIT, None),
TEMPERATURE,
default=self.config_entry.options.get(TEMPERATURE, None),
): vol.In([UnitOfTemperature.CELSIUS, UnitOfTemperature.FAHRENHEIT]),
vol.Optional(
CONF_WEIGHT_UNIT,
Expand Down
1 change: 0 additions & 1 deletion custom_components/babybuddy/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
DOMAIN: Final = "babybuddy"

CONF_FEEDING_UNIT: Final = "feedings"
CONF_TEMPERATURE_UNIT: Final = "temperature"
CONF_WEIGHT_UNIT: Final = "weight"

DEFAULT_NAME: Final = "Baby Buddy"
Expand Down

0 comments on commit 4f3be82

Please sign in to comment.