Compare commits

...

18 Commits

Author SHA1 Message Date
Jesse Hills ec377c290c
Fix import order 2024-04-22 05:05:34 +00:00
Jesse Hills 60dd1f4f3c
Add model tests 2024-04-22 05:05:34 +00:00
Jesse Hills abb36ad92d
Add missing device_class to EventInfo 2024-04-22 05:05:34 +00:00
Jesse Hills 13bbbd0d24
Sort import 2024-04-22 05:05:34 +00:00
David Friedland 4b6df1bf0e
Support for Event entity messages 2024-04-22 05:05:34 +00:00
Jesse Hills 397c64f3e3
Alphabetise model_conversions.py (#864) 2024-04-22 17:04:38 +12:00
github-actions[bot] 0257210087 Bump version to 24.2.0 2024-04-22 03:58:30 +00:00
Jesse Hills b935707ceb
Add Datetime entities (#859) 2024-04-22 15:58:16 +12:00
dependabot[bot] 27247a5192
Bump types-protobuf from 4.25.0.20240410 to 4.25.0.20240417 (#863)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-18 17:25:28 +12:00
github-actions[bot] 01eaee25c0 Bump version to 24.1.1 2024-04-17 21:18:54 +00:00
J. Nick Koston 4cff8555d2
Remove zeroconf listener removal workaround (#860) 2024-04-17 16:18:36 -05:00
github-actions[bot] 56369fb332 Bump version to 24.1.0 2024-04-17 01:50:05 +00:00
Keith Burzinski 0ed69bbb30
Add valve component (#852)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-04-17 13:45:33 +12:00
dependabot[bot] b10cbd6c9a
Bump types-protobuf from 4.24.0.20240311 to 4.25.0.20240410 (#858)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-17 10:27:59 +12:00
dependabot[bot] d9dde5bc14
Bump black from 24.3.0 to 24.4.0 (#861)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-17 10:26:57 +12:00
Jesse Hills 0ad9dd5aa5
Use trusted publishing token (#862) 2024-04-17 10:26:39 +12:00
Jesse Hills 725e501815
Remove deprecated settings for devcontainer (#857) 2024-04-12 11:29:29 +12:00
dependabot[bot] 78f6ed9e63
Bump docker/setup-buildx-action from 3.2.0 to 3.3.0 (#856)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 16:38:04 +12:00
16 changed files with 502 additions and 87 deletions

View File

@ -19,8 +19,6 @@
"settings": {
"python.languageServer": "Pylance",
"python.pythonPath": "/usr/bin/python3",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "black",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,

View File

@ -44,7 +44,7 @@ jobs:
uses: docker/setup-qemu-action@v3.0.0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.2.0
uses: docker/setup-buildx-action@v3.3.0
-
name: Build and Push
uses: docker/build-push-action@v5.3.0

View File

@ -58,11 +58,11 @@ jobs:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.14

View File

@ -44,9 +44,11 @@ service APIConnection {
rpc siren_command (SirenCommandRequest) returns (void) {}
rpc button_command (ButtonCommandRequest) returns (void) {}
rpc lock_command (LockCommandRequest) returns (void) {}
rpc valve_command (ValveCommandRequest) returns (void) {}
rpc media_player_command (MediaPlayerCommandRequest) returns (void) {}
rpc date_command (DateCommandRequest) returns (void) {}
rpc time_command (TimeCommandRequest) returns (void) {}
rpc datetime_command (DateTimeCommandRequest) returns (void) {}
rpc subscribe_bluetooth_le_advertisements (SubscribeBluetoothLEAdvertisementsRequest) returns (void) {}
rpc bluetooth_device_request(BluetoothDeviceRequest) returns (void) {}
@ -1718,3 +1720,116 @@ message TimeCommandRequest {
uint32 minute = 3;
uint32 second = 4;
}
// ==================== EVENT ====================
message ListEntitiesEventResponse {
option (id) = 107;
option (source) = SOURCE_SERVER;
option (ifdef) = "USE_EVENT";
string object_id = 1;
fixed32 key = 2;
string name = 3;
string unique_id = 4;
string icon = 5;
bool disabled_by_default = 6;
EntityCategory entity_category = 7;
string device_class = 8;
repeated string event_types = 9;
}
message EventResponse {
option (id) = 108;
option (source) = SOURCE_SERVER;
option (ifdef) = "USE_EVENT";
fixed32 key = 1;
string event_type = 2;
}
// ==================== VALVE ====================
message ListEntitiesValveResponse {
option (id) = 109;
option (source) = SOURCE_SERVER;
option (ifdef) = "USE_VALVE";
string object_id = 1;
fixed32 key = 2;
string name = 3;
string unique_id = 4;
string icon = 5;
bool disabled_by_default = 6;
EntityCategory entity_category = 7;
string device_class = 8;
bool assumed_state = 9;
bool supports_position = 10;
bool supports_stop = 11;
}
enum ValveOperation {
VALVE_OPERATION_IDLE = 0;
VALVE_OPERATION_IS_OPENING = 1;
VALVE_OPERATION_IS_CLOSING = 2;
}
message ValveStateResponse {
option (id) = 110;
option (source) = SOURCE_SERVER;
option (ifdef) = "USE_VALVE";
option (no_delay) = true;
fixed32 key = 1;
float position = 2;
ValveOperation current_operation = 3;
}
message ValveCommandRequest {
option (id) = 111;
option (source) = SOURCE_CLIENT;
option (ifdef) = "USE_VALVE";
option (no_delay) = true;
fixed32 key = 1;
bool has_position = 2;
float position = 3;
bool stop = 4;
}
// ==================== DATETIME DATETIME ====================
message ListEntitiesDateTimeResponse {
option (id) = 112;
option (source) = SOURCE_SERVER;
option (ifdef) = "USE_DATETIME_DATETIME";
string object_id = 1;
fixed32 key = 2;
string name = 3;
string unique_id = 4;
string icon = 5;
bool disabled_by_default = 6;
EntityCategory entity_category = 7;
}
message DateTimeStateResponse {
option (id) = 113;
option (source) = SOURCE_SERVER;
option (ifdef) = "USE_DATETIME_DATETIME";
option (no_delay) = true;
fixed32 key = 1;
// If the datetime does not have a valid state yet.
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
bool missing_state = 2;
fixed32 epoch_seconds = 3;
}
message DateTimeCommandRequest {
option (id) = 114;
option (source) = SOURCE_CLIENT;
option (ifdef) = "USE_DATETIME_DATETIME";
option (no_delay) = true;
fixed32 key = 1;
fixed32 epoch_seconds = 2;
}

File diff suppressed because one or more lines are too long

View File

@ -38,6 +38,7 @@ from .api_pb2 import ( # type: ignore
ClimateCommandRequest,
CoverCommandRequest,
DateCommandRequest,
DateTimeCommandRequest,
DeviceInfoRequest,
DeviceInfoResponse,
ExecuteServiceArgument,
@ -67,6 +68,7 @@ from .api_pb2 import ( # type: ignore
TextCommandRequest,
TimeCommandRequest,
UnsubscribeBluetoothLEAdvertisementsRequest,
ValveCommandRequest,
VoiceAssistantAudio,
VoiceAssistantEventData,
VoiceAssistantEventResponse,
@ -1117,6 +1119,18 @@ class APIClient:
TimeCommandRequest(key=key, hour=hour, minute=minute, second=second)
)
def datetime_command(
self,
key: int,
epoch_seconds: int,
) -> None:
self._get_connection().send_message(
DateTimeCommandRequest(
key=key,
epoch_seconds=epoch_seconds,
)
)
def select_command(self, key: int, state: str) -> None:
self._get_connection().send_message(SelectCommandRequest(key=key, state=state))
@ -1157,6 +1171,20 @@ class APIClient:
req.code = code
self._get_connection().send_message(req)
def valve_command(
self,
key: int,
position: float | None = None,
stop: bool = False,
) -> None:
req = ValveCommandRequest(key=key)
if position is not None:
req.has_position = True
req.position = position
if stop:
req.stop = stop
self._get_connection().send_message(req)
def media_player_command(
self,
key: int,

View File

@ -40,10 +40,13 @@ from .api_pb2 import ( # type: ignore
CoverStateResponse,
DateCommandRequest,
DateStateResponse,
DateTimeCommandRequest,
DateTimeStateResponse,
DeviceInfoRequest,
DeviceInfoResponse,
DisconnectRequest,
DisconnectResponse,
EventResponse,
ExecuteServiceRequest,
FanCommandRequest,
FanStateResponse,
@ -62,7 +65,9 @@ from .api_pb2 import ( # type: ignore
ListEntitiesClimateResponse,
ListEntitiesCoverResponse,
ListEntitiesDateResponse,
ListEntitiesDateTimeResponse,
ListEntitiesDoneResponse,
ListEntitiesEventResponse,
ListEntitiesFanResponse,
ListEntitiesLightResponse,
ListEntitiesLockResponse,
@ -77,6 +82,7 @@ from .api_pb2 import ( # type: ignore
ListEntitiesTextResponse,
ListEntitiesTextSensorResponse,
ListEntitiesTimeResponse,
ListEntitiesValveResponse,
LockCommandRequest,
LockStateResponse,
MediaPlayerCommandRequest,
@ -107,6 +113,8 @@ from .api_pb2 import ( # type: ignore
TimeCommandRequest,
TimeStateResponse,
UnsubscribeBluetoothLEAdvertisementsRequest,
ValveCommandRequest,
ValveStateResponse,
VoiceAssistantAudio,
VoiceAssistantEventResponse,
VoiceAssistantRequest,
@ -368,4 +376,12 @@ MESSAGE_TYPE_TO_PROTO = {
104: TimeStateResponse,
105: TimeCommandRequest,
106: VoiceAssistantAudio,
107: ListEntitiesEventResponse,
108: EventResponse,
109: ListEntitiesValveResponse,
110: ValveStateResponse,
111: ValveCommandRequest,
112: ListEntitiesDateTimeResponse,
113: DateTimeStateResponse,
114: DateTimeCommandRequest,
}

View File

@ -262,6 +262,18 @@ class CoverState(EntityState):
return self.position == 0.0
# ==================== EVENT ==================
@_frozen_dataclass_decorator
class EventInfo(EntityInfo):
device_class: str = ""
event_types: list[str] = converter_field(default_factory=list, converter=list)
@_frozen_dataclass_decorator
class Event(EntityState):
event_type: str = ""
# ==================== FAN ====================
@_frozen_dataclass_decorator
class FanInfo(EntityInfo):
@ -690,6 +702,18 @@ class TimeState(EntityState):
second: int = 0
# ==================== DATETIME DATETIME ====================
@_frozen_dataclass_decorator
class DateTimeInfo(EntityInfo):
pass
@_frozen_dataclass_decorator
class DateTimeState(EntityState):
missing_state: bool = False
epoch_seconds: int = 0
# ==================== SELECT ====================
@_frozen_dataclass_decorator
class SelectInfo(EntityInfo):
@ -753,6 +777,31 @@ class LockEntityState(EntityState):
)
# ==================== VALVE ====================
@_frozen_dataclass_decorator
class ValveInfo(EntityInfo):
device_class: str = ""
assumed_state: bool = False
supports_stop: bool = False
supports_position: bool = False
class ValveOperation(APIIntEnum):
IDLE = 0
IS_OPENING = 1
IS_CLOSING = 2
@_frozen_dataclass_decorator
class ValveState(EntityState):
position: float = converter_field(
default=0.0, converter=fix_float_single_double_conversion
)
current_operation: ValveOperation | None = converter_field(
default=ValveOperation.IDLE, converter=ValveOperation.convert
)
# ==================== MEDIA PLAYER ====================
class MediaPlayerState(APIIntEnum):
NONE = 0
@ -860,6 +909,7 @@ COMPONENT_TYPE_TO_INFO: dict[str, type[EntityInfo]] = {
"climate": ClimateInfo,
"number": NumberInfo,
"date": DateInfo,
"datetime": DateTimeInfo,
"select": SelectInfo,
"siren": SirenInfo,
"button": ButtonInfo,
@ -868,6 +918,8 @@ COMPONENT_TYPE_TO_INFO: dict[str, type[EntityInfo]] = {
"alarm_control_panel": AlarmControlPanelInfo,
"text": TextInfo,
"time": TimeInfo,
"valve": ValveInfo,
"event": EventInfo,
}
@ -1216,6 +1268,7 @@ _TYPE_TO_NAME = {
LightInfo: "light",
NumberInfo: "number",
DateInfo: "date",
DateTimeInfo: "datetime",
SelectInfo: "select",
SensorInfo: "sensor",
SirenInfo: "siren",
@ -1228,6 +1281,8 @@ _TYPE_TO_NAME = {
AlarmControlPanelInfo: "alarm_control_panel",
TextInfo: "text_info",
TimeInfo: "time",
ValveInfo: "valve",
EventInfo: "event",
}

View File

@ -8,6 +8,8 @@ from .api_pb2 import ( # type: ignore
ClimateStateResponse,
CoverStateResponse,
DateStateResponse,
DateTimeStateResponse,
EventResponse,
FanStateResponse,
LightStateResponse,
ListEntitiesAlarmControlPanelResponse,
@ -17,6 +19,8 @@ from .api_pb2 import ( # type: ignore
ListEntitiesClimateResponse,
ListEntitiesCoverResponse,
ListEntitiesDateResponse,
ListEntitiesDateTimeResponse,
ListEntitiesEventResponse,
ListEntitiesFanResponse,
ListEntitiesLightResponse,
ListEntitiesLockResponse,
@ -30,6 +34,7 @@ from .api_pb2 import ( # type: ignore
ListEntitiesTextResponse,
ListEntitiesTextSensorResponse,
ListEntitiesTimeResponse,
ListEntitiesValveResponse,
LockStateResponse,
MediaPlayerStateResponse,
NumberStateResponse,
@ -40,6 +45,7 @@ from .api_pb2 import ( # type: ignore
TextSensorStateResponse,
TextStateResponse,
TimeStateResponse,
ValveStateResponse,
)
from .model import (
AlarmControlPanelEntityState,
@ -54,8 +60,12 @@ from .model import (
CoverState,
DateInfo,
DateState,
DateTimeInfo,
DateTimeState,
EntityInfo,
EntityState,
Event,
EventInfo,
FanInfo,
FanState,
LightInfo,
@ -80,47 +90,55 @@ from .model import (
TextState,
TimeInfo,
TimeState,
ValveInfo,
ValveState,
)
SUBSCRIBE_STATES_RESPONSE_TYPES: dict[Any, type[EntityState]] = {
AlarmControlPanelStateResponse: AlarmControlPanelEntityState,
BinarySensorStateResponse: BinarySensorState,
ClimateStateResponse: ClimateState,
CoverStateResponse: CoverState,
DateStateResponse: DateState,
DateTimeStateResponse: DateTimeState,
EventResponse: Event,
FanStateResponse: FanState,
LightStateResponse: LightState,
LockStateResponse: LockEntityState,
MediaPlayerStateResponse: MediaPlayerEntityState,
NumberStateResponse: NumberState,
DateStateResponse: DateState,
SelectStateResponse: SelectState,
SensorStateResponse: SensorState,
SirenStateResponse: SirenState,
SwitchStateResponse: SwitchState,
TextStateResponse: TextState,
TextSensorStateResponse: TextSensorState,
ClimateStateResponse: ClimateState,
LockStateResponse: LockEntityState,
MediaPlayerStateResponse: MediaPlayerEntityState,
AlarmControlPanelStateResponse: AlarmControlPanelEntityState,
TextStateResponse: TextState,
TimeStateResponse: TimeState,
ValveStateResponse: ValveState,
}
LIST_ENTITIES_SERVICES_RESPONSE_TYPES: dict[Any, type[EntityInfo] | None] = {
ListEntitiesAlarmControlPanelResponse: AlarmControlPanelInfo,
ListEntitiesBinarySensorResponse: BinarySensorInfo,
ListEntitiesButtonResponse: ButtonInfo,
ListEntitiesCameraResponse: CameraInfo,
ListEntitiesClimateResponse: ClimateInfo,
ListEntitiesCoverResponse: CoverInfo,
ListEntitiesDateResponse: DateInfo,
ListEntitiesDateTimeResponse: DateTimeInfo,
ListEntitiesEventResponse: EventInfo,
ListEntitiesFanResponse: FanInfo,
ListEntitiesLightResponse: LightInfo,
ListEntitiesLockResponse: LockInfo,
ListEntitiesMediaPlayerResponse: MediaPlayerInfo,
ListEntitiesNumberResponse: NumberInfo,
ListEntitiesDateResponse: DateInfo,
ListEntitiesSelectResponse: SelectInfo,
ListEntitiesSensorResponse: SensorInfo,
ListEntitiesServicesResponse: None,
ListEntitiesSirenResponse: SirenInfo,
ListEntitiesSwitchResponse: SwitchInfo,
ListEntitiesTextResponse: TextInfo,
ListEntitiesTextSensorResponse: TextSensorInfo,
ListEntitiesServicesResponse: None,
ListEntitiesCameraResponse: CameraInfo,
ListEntitiesClimateResponse: ClimateInfo,
ListEntitiesLockResponse: LockInfo,
ListEntitiesMediaPlayerResponse: MediaPlayerInfo,
ListEntitiesAlarmControlPanelResponse: AlarmControlPanelInfo,
ListEntitiesTimeResponse: TimeInfo,
ListEntitiesValveResponse: ValveInfo,
}

View File

@ -413,16 +413,11 @@ class ReconnectLogic(zeroconf.RecordUpdateListener):
self._cli.log_name,
record_update.new,
)
# We can't stop the zeroconf listener here because we are in the middle of
# a zeroconf callback which is iterating the listeners.
#
# So we schedule a stop for the next event loop iteration as well as the
# connect attempt.
#
# If we scheduled the connect attempt immediately, the listener could fire
# again before the connect attempt and we cancel and reschedule the connect
# attempt again.
#
self.loop.call_soon(self._connect_from_zeroconf)
self._connect_from_zeroconf()
self._accept_zeroconf_records = False
return

View File

@ -1,7 +1,7 @@
aiohappyeyeballs>=2.3.0
async-interrupt>=1.1.1
protobuf>=3.19.0
zeroconf>=0.128.4,<1.0
zeroconf>=0.132.2,<1.0
chacha20poly1305-reuseable>=0.12.1
cryptography>=42.0.2
noiseprotocol>=0.3.1,<1.0

View File

@ -1,9 +1,9 @@
pylint==3.1.0
black==24.3.0
black==24.4.0
flake8==7.0.0
isort==5.13.2
mypy==1.9.0
types-protobuf==4.24.0.20240311
types-protobuf==4.25.0.20240417
pytest>=6.2.4,<9
pytest-asyncio==0.23.6
mock>=4.0.3,<6

View File

@ -11,7 +11,7 @@ with open(os.path.join(here, "README.rst"), encoding="utf-8") as readme_file:
long_description = readme_file.read()
VERSION = "24.0.1"
VERSION = "24.2.0"
PROJECT_NAME = "aioesphomeapi"
PROJECT_PACKAGE_NAME = "aioesphomeapi"
PROJECT_LICENSE = "MIT"

View File

@ -42,6 +42,7 @@ from aioesphomeapi.api_pb2 import (
ClimateCommandRequest,
CoverCommandRequest,
DateCommandRequest,
DateTimeCommandRequest,
DeviceInfoResponse,
DisconnectResponse,
ExecuteServiceArgument,
@ -64,6 +65,7 @@ from aioesphomeapi.api_pb2 import (
SwitchCommandRequest,
TextCommandRequest,
TimeCommandRequest,
ValveCommandRequest,
VoiceAssistantAudio,
VoiceAssistantAudioSettings,
VoiceAssistantEventData,
@ -667,6 +669,30 @@ async def test_time_command(
send.assert_called_once_with(TimeCommandRequest(**req))
# Test date_time command
@pytest.mark.asyncio
@pytest.mark.parametrize(
"cmd, req",
[
(
dict(key=1, epoch_seconds=1735648230),
dict(key=1, epoch_seconds=1735648230),
),
(
dict(key=1, epoch_seconds=1735689600),
dict(key=1, epoch_seconds=1735689600),
),
],
)
async def test_datetime_command(
auth_client: APIClient, cmd: dict[str, Any], req: dict[str, Any]
) -> None:
send = patch_send(auth_client)
auth_client.datetime_command(**cmd)
send.assert_called_once_with(DateTimeCommandRequest(**req))
@pytest.mark.asyncio
@pytest.mark.parametrize(
"cmd, req",
@ -692,6 +718,49 @@ async def test_lock_command(
send.assert_called_once_with(LockCommandRequest(**req))
@pytest.mark.asyncio
@pytest.mark.parametrize(
"cmd, req",
[
(dict(key=1), dict(key=1)),
(dict(key=1, position=1.0),),
(dict(key=1, position=0.0),),
(dict(key=1, stop=True),),
],
)
async def test_valve_command(
auth_client: APIClient, cmd: dict[str, Any], req: dict[str, Any]
) -> None:
send = patch_send(auth_client)
auth_client.valve_command(**cmd)
send.assert_called_once_with(ValveCommandRequest(**req))
@pytest.mark.asyncio
@pytest.mark.parametrize(
"cmd, req",
[
(dict(key=1), dict(key=1)),
(dict(key=1, position=0.5), dict(key=1, has_position=True, position=0.5)),
(dict(key=1, position=0.0), dict(key=1, has_position=True, position=0.0)),
(dict(key=1, stop=True), dict(key=1, stop=True)),
(
dict(key=1, position=1.0),
dict(key=1, has_position=True, position=1.0),
),
],
)
async def test_valve_command(
auth_client: APIClient, cmd: dict[str, Any], req: dict[str, Any]
) -> None:
send = patch_send(auth_client)
patch_api_version(auth_client, APIVersion(1, 1))
auth_client.valve_command(**cmd)
send.assert_called_once_with(ValveCommandRequest(**req))
@pytest.mark.asyncio
@pytest.mark.parametrize(
"cmd, req",
@ -2443,6 +2512,7 @@ async def test_calls_after_connection_closed(
client.cover_command,
client.fan_command,
client.light_command,
client.valve_command,
client.media_player_command,
client.siren_command,
):

View File

@ -14,7 +14,9 @@ from aioesphomeapi.api_pb2 import (
ClimateStateResponse,
CoverStateResponse,
DateStateResponse,
DateTimeStateResponse,
DeviceInfoResponse,
EventResponse,
FanStateResponse,
HomeassistantServiceMap,
HomeassistantServiceResponse,
@ -25,6 +27,8 @@ from aioesphomeapi.api_pb2 import (
ListEntitiesClimateResponse,
ListEntitiesCoverResponse,
ListEntitiesDateResponse,
ListEntitiesDateTimeResponse,
ListEntitiesEventResponse,
ListEntitiesFanResponse,
ListEntitiesLightResponse,
ListEntitiesLockResponse,
@ -37,6 +41,7 @@ from aioesphomeapi.api_pb2 import (
ListEntitiesSwitchResponse,
ListEntitiesTextSensorResponse,
ListEntitiesTimeResponse,
ListEntitiesValveResponse,
LockStateResponse,
MediaPlayerStateResponse,
NumberStateResponse,
@ -47,6 +52,7 @@ from aioesphomeapi.api_pb2 import (
TextSensorStateResponse,
TextStateResponse,
TimeStateResponse,
ValveStateResponse,
)
from aioesphomeapi.model import (
_TYPE_TO_NAME,
@ -75,7 +81,11 @@ from aioesphomeapi.model import (
CoverState,
DateInfo,
DateState,
DateTimeInfo,
DateTimeState,
DeviceInfo,
Event,
EventInfo,
FanInfo,
FanState,
HomeassistantServiceCall,
@ -105,6 +115,8 @@ from aioesphomeapi.model import (
UserService,
UserServiceArg,
UserServiceArgType,
ValveInfo,
ValveState,
VoiceAssistantFeature,
build_unique_id,
converter_field,
@ -261,6 +273,8 @@ def test_api_version_ord():
(ButtonInfo, ListEntitiesButtonResponse),
(LockInfo, ListEntitiesLockResponse),
(LockEntityState, LockStateResponse),
(ValveInfo, ListEntitiesValveResponse),
(ValveState, ValveStateResponse),
(MediaPlayerInfo, ListEntitiesMediaPlayerResponse),
(MediaPlayerEntityState, MediaPlayerStateResponse),
(AlarmControlPanelInfo, ListEntitiesAlarmControlPanelResponse),
@ -268,6 +282,10 @@ def test_api_version_ord():
(TextState, TextStateResponse),
(TimeInfo, ListEntitiesTimeResponse),
(TimeState, TimeStateResponse),
(DateTimeInfo, ListEntitiesDateTimeResponse),
(DateTimeState, DateTimeStateResponse),
(EventInfo, ListEntitiesEventResponse),
(Event, EventResponse),
],
)
def test_basic_pb_conversions(model, pb):
@ -380,6 +398,7 @@ def test_user_service_conversion():
CameraInfo,
ClimateInfo,
LockInfo,
ValveInfo,
MediaPlayerInfo,
AlarmControlPanelInfo,
TextInfo,

View File

@ -441,8 +441,6 @@ async def test_reconnect_zeroconf(
"Triggering connect because of received mDNS record" in caplog.text
) is should_trigger_zeroconf
assert rl._accept_zeroconf_records is not should_trigger_zeroconf
assert rl._zc_listening is True # should change after one iteration of the loop
await asyncio.sleep(0)
assert rl._zc_listening is not should_trigger_zeroconf
# The reconnect is scheduled to run in the next loop iteration