use intenum

This commit is contained in:
suaveolent 2024-04-22 17:28:19 +02:00
parent b35e59adab
commit aa3aae751a

View File

@ -6,7 +6,7 @@ import asyncio
import struct import struct
import time import time
from datetime import datetime from datetime import datetime
from enum import Enum from enum import Enum, IntEnum
from typing import Any from typing import Any
from crcmod import mkCrcFun from crcmod import mkCrcFun
@ -49,17 +49,13 @@ from hoymiles_wifi.protobuf import (
from hoymiles_wifi.utils import initialize_set_config from hoymiles_wifi.utils import initialize_set_config
class NetmodeSelect(Enum): class NetmodeSelect(IntEnum):
"""Network mode selection.""" """Network mode selection."""
WIFI = 1 WIFI = 1
SIM = 2 SIM = 2
LAN = 3 LAN = 3
def __int__(self):
"""Return the integer value of the network mode selection."""
return self.value
class NetworkState(Enum): class NetworkState(Enum):
"""Network state.""" """Network state."""