From 8371fe520e5bf9297063f80fc775b6f9af12329e Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 6 Nov 2023 20:24:01 +0100 Subject: [PATCH] Update elgato to 5.1.0 (#103530) --- homeassistant/components/elgato/diagnostics.py | 4 ++-- homeassistant/components/elgato/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/elgato/conftest.py | 8 ++++---- .../elgato/snapshots/test_diagnostics.ambr | 18 +++++++----------- 6 files changed, 16 insertions(+), 20 deletions(-) diff --git a/homeassistant/components/elgato/diagnostics.py b/homeassistant/components/elgato/diagnostics.py index c63290f736f..46730b8f005 100644 --- a/homeassistant/components/elgato/diagnostics.py +++ b/homeassistant/components/elgato/diagnostics.py @@ -16,6 +16,6 @@ async def async_get_config_entry_diagnostics( """Return diagnostics for a config entry.""" coordinator: ElgatoDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id] return { - "info": coordinator.data.info.dict(), - "state": coordinator.data.state.dict(), + "info": coordinator.data.info.to_dict(), + "state": coordinator.data.state.to_dict(), } diff --git a/homeassistant/components/elgato/manifest.json b/homeassistant/components/elgato/manifest.json index 49340f028d0..033a2567bb4 100644 --- a/homeassistant/components/elgato/manifest.json +++ b/homeassistant/components/elgato/manifest.json @@ -7,6 +7,6 @@ "integration_type": "device", "iot_class": "local_polling", "quality_scale": "platinum", - "requirements": ["elgato==5.0.0"], + "requirements": ["elgato==5.1.0"], "zeroconf": ["_elg._tcp.local."] } diff --git a/requirements_all.txt b/requirements_all.txt index c88824011bb..091007590cb 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -734,7 +734,7 @@ ecoaliface==0.4.0 electrickiwi-api==0.8.5 # homeassistant.components.elgato -elgato==5.0.0 +elgato==5.1.0 # homeassistant.components.eliqonline eliqonline==1.2.2 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 7d3ab02287b..9c0225162ae 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -596,7 +596,7 @@ easyenergy==0.3.0 electrickiwi-api==0.8.5 # homeassistant.components.elgato -elgato==5.0.0 +elgato==5.1.0 # homeassistant.components.elkm1 elkm1-lib==2.2.6 diff --git a/tests/components/elgato/conftest.py b/tests/components/elgato/conftest.py index bd1b4242ede..e8be6a4810b 100644 --- a/tests/components/elgato/conftest.py +++ b/tests/components/elgato/conftest.py @@ -70,20 +70,20 @@ def mock_elgato( "homeassistant.components.elgato.config_flow.Elgato", new=elgato_mock ): elgato = elgato_mock.return_value - elgato.info.return_value = Info.parse_raw( + elgato.info.return_value = Info.from_json( load_fixture(f"{device_fixtures}/info.json", DOMAIN) ) - elgato.state.return_value = State.parse_raw( + elgato.state.return_value = State.from_json( load_fixture(f"{device_fixtures}/{state_variant}.json", DOMAIN) ) - elgato.settings.return_value = Settings.parse_raw( + elgato.settings.return_value = Settings.from_json( load_fixture(f"{device_fixtures}/settings.json", DOMAIN) ) # This may, or may not, be a battery-powered device if get_fixture_path(f"{device_fixtures}/battery.json", DOMAIN).exists(): elgato.has_battery.return_value = True - elgato.battery.return_value = BatteryInfo.parse_raw( + elgato.battery.return_value = BatteryInfo.from_json( load_fixture(f"{device_fixtures}/battery.json", DOMAIN) ) else: diff --git a/tests/components/elgato/snapshots/test_diagnostics.ambr b/tests/components/elgato/snapshots/test_diagnostics.ambr index a22dc07f717..c3996c8dd45 100644 --- a/tests/components/elgato/snapshots/test_diagnostics.ambr +++ b/tests/components/elgato/snapshots/test_diagnostics.ambr @@ -2,23 +2,19 @@ # name: test_diagnostics dict({ 'info': dict({ - 'display_name': 'Frenck', + 'displayName': 'Frenck', 'features': list([ 'lights', ]), - 'firmware_build_number': 192, - 'firmware_version': '1.0.3', - 'hardware_board_type': 53, - 'mac_address': None, - 'product_name': 'Elgato Key Light', - 'serial_number': 'CN11A1A00001', - 'wifi': None, + 'firmwareBuildNumber': 192, + 'firmwareVersion': '1.0.3', + 'hardwareBoardType': 53, + 'productName': 'Elgato Key Light', + 'serialNumber': 'CN11A1A00001', }), 'state': dict({ 'brightness': 21, - 'hue': None, - 'on': True, - 'saturation': None, + 'on': 1, 'temperature': 297, }), })