Skip to content

Commit

Permalink
fix: make enums lower case
Browse files Browse the repository at this point in the history
  • Loading branch information
Lash-L committed Feb 3, 2024
1 parent 5c92d6d commit 0dd1699
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/anova_wifi/web_socket_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ class APCUpdate:


class AnovaMode(str, Enum):
STARTUP = "STARTUP"
IDLE = "IDLE"
COOK = "COOK"
LOW_WATER = "LOW WATER"
OTA = "OTA"
PROVISIONING = "PROVISIONING"
HIGH_TEMP = "HIGH TEMP"
DEVICE_FAILURE = "DEVICE FAILURE"
startup = "STARTUP"
idle = "IDLE"
cook = "COOK"
low_water = "LOW WATER"
ota = "OTA"
provisioning = "PROVISIONING"
high_temp = "HIGH TEMP"
device_failure = "DEVICE FAILURE"


class AnovaState(str, Enum):
PREHEATING = "PREHEATING"
COOKING = "COOKING"
MAINTAINING = "MAINTAINING"
TIMER_EXPIRED = "TIMER EXPIRED"
SET_TIMER = "SET TIMER"
NO_STATE = ""
preheating = "PREHEATING"
cooking = "COOKING"
maintaining = "MAINTAINING"
timer_expired = "TIMER EXPIRED"
set_timer = "SET TIMER"
no_state = ""


class AnovaCommand(str, Enum):
Expand Down Expand Up @@ -163,8 +163,8 @@ def firmware_version(self) -> str:
def to_apc_update(self) -> APCUpdate:
sensors = APCUpdateSensor(
cook_time=self.job.cook_time_seconds,
mode=self.job.mode.value,
state=self.job_status.state.value,
mode=self.job.mode.name,
state=self.job_status.state.name,
target_temperature=self.job.target_temperature,
cook_time_remaining=self.job_status.cook_time_remaining,
firmware_version=self.firmware_version,
Expand All @@ -174,11 +174,11 @@ def to_apc_update(self) -> APCUpdate:
)

binary_sensors = APCUpdateBinary(
cooking=bool(self.job.mode == AnovaMode.COOK),
preheating=bool(self.job_status.state == AnovaState.PREHEATING),
cooking=bool(self.job.mode == AnovaMode.cook),
preheating=bool(self.job_status.state == AnovaState.preheating),
maintaining=bool(
self.job_status.state == AnovaState.MAINTAINING
or self.job_status.state == AnovaState.TIMER_EXPIRED
self.job_status.state == AnovaState.maintaining
or self.job_status.state == AnovaState.timer_expired
),
device_safe=self.pin_info.is_device_safe,
water_leak=self.pin_info.is_water_leak,
Expand Down

0 comments on commit 0dd1699

Please sign in to comment.