mirror of
https://github.com/suaveolent/hoymiles-wifi.git
synced 2024-09-20 03:10:11 +00:00
use intenum
This commit is contained in:
parent
b35e59adab
commit
aa3aae751a
@ -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."""
|
||||||
|
Loading…
Reference in New Issue
Block a user