diff --git a/homeassistant/components/github/__init__.py b/homeassistant/components/github/__init__.py index 20706c1acbc..20df559b819 100644 --- a/homeassistant/components/github/__init__.py +++ b/homeassistant/components/github/__init__.py @@ -26,7 +26,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: client = GitHubAPI( token=entry.data[CONF_ACCESS_TOKEN], session=async_get_clientsession(hass), - **{"client_name": SERVER_SOFTWARE}, + client_name=SERVER_SOFTWARE, ) repositories: list[str] = entry.options[CONF_REPOSITORIES] diff --git a/homeassistant/components/github/config_flow.py b/homeassistant/components/github/config_flow.py index 2d9440928e3..25d8782618f 100644 --- a/homeassistant/components/github/config_flow.py +++ b/homeassistant/components/github/config_flow.py @@ -38,12 +38,12 @@ async def get_repositories(hass: HomeAssistant, access_token: str) -> list[str]: repositories = set() async def _get_starred_repositories() -> None: - response = await client.user.starred(**{"params": {"per_page": 100}}) + response = await client.user.starred(params={"per_page": 100}) if not response.is_last_page: results = await asyncio.gather( *( client.user.starred( - **{"params": {"per_page": 100, "page": page_number}}, + params={"per_page": 100, "page": page_number}, ) for page_number in range( response.next_page_number, response.last_page_number + 1 @@ -56,12 +56,12 @@ async def get_repositories(hass: HomeAssistant, access_token: str) -> list[str]: repositories.update(response.data) async def _get_personal_repositories() -> None: - response = await client.user.repos(**{"params": {"per_page": 100}}) + response = await client.user.repos(params={"per_page": 100}) if not response.is_last_page: results = await asyncio.gather( *( client.user.repos( - **{"params": {"per_page": 100, "page": page_number}}, + params={"per_page": 100, "page": page_number}, ) for page_number in range( response.next_page_number, response.last_page_number + 1 @@ -137,7 +137,7 @@ class GitHubConfigFlow(ConfigFlow, domain=DOMAIN): self._device = GitHubDeviceAPI( client_id=CLIENT_ID, session=async_get_clientsession(self.hass), - **{"client_name": SERVER_SOFTWARE}, + client_name=SERVER_SOFTWARE, ) try: diff --git a/homeassistant/components/github/diagnostics.py b/homeassistant/components/github/diagnostics.py index 37313be3690..df1e4b4a4cf 100644 --- a/homeassistant/components/github/diagnostics.py +++ b/homeassistant/components/github/diagnostics.py @@ -27,7 +27,7 @@ async def async_get_config_entry_diagnostics( client = GitHubAPI( token=config_entry.data[CONF_ACCESS_TOKEN], session=async_get_clientsession(hass), - **{"client_name": SERVER_SOFTWARE}, + client_name=SERVER_SOFTWARE, ) try: diff --git a/homeassistant/components/iqvia/__init__.py b/homeassistant/components/iqvia/__init__.py index 8f85d98c576..27d7d46f677 100644 --- a/homeassistant/components/iqvia/__init__.py +++ b/homeassistant/components/iqvia/__init__.py @@ -47,7 +47,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: if not entry.unique_id: # If the config entry doesn't already have a unique ID, set one: hass.config_entries.async_update_entry( - entry, **{"unique_id": entry.data[CONF_ZIP_CODE]} + entry, unique_id=entry.data[CONF_ZIP_CODE] ) websession = aiohttp_client.async_get_clientsession(hass) diff --git a/pyproject.toml b/pyproject.toml index 04aca768267..c10562c0fa2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -605,6 +605,7 @@ select = [ "N815", # Variable {name} in class scope should not be mixedCase "PERF", # Perflint "PGH004", # Use specific rule codes when using noqa + "PIE804", # Unnecessary dict kwargs "PIE790", # Unnecessary pass statement "PIE794", # Class field is defined multiple times "PIE807", # Prefer list/dict over useless lambda diff --git a/tests/components/aladdin_connect/test_sensor.py b/tests/components/aladdin_connect/test_sensor.py index c6fac4cf79e..9c229e2ac5e 100644 --- a/tests/components/aladdin_connect/test_sensor.py +++ b/tests/components/aladdin_connect/test_sensor.py @@ -53,7 +53,7 @@ async def test_sensors( assert entry.disabled assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION update_entry = entity_registry.async_update_entity( - entry.entity_id, **{"disabled_by": None} + entry.entity_id, disabled_by=None ) await hass.async_block_till_done() assert update_entry != entry @@ -75,7 +75,7 @@ async def test_sensors( assert entry.disabled assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION update_entry = entity_registry.async_update_entity( - entry.entity_id, **{"disabled_by": None} + entry.entity_id, disabled_by=None ) await hass.async_block_till_done() assert update_entry != entry @@ -84,7 +84,7 @@ async def test_sensors( assert state is None update_entry = entity_registry.async_update_entity( - entry.entity_id, **{"disabled_by": None} + entry.entity_id, disabled_by=None ) await hass.async_block_till_done() async_fire_time_changed( @@ -135,7 +135,7 @@ async def test_sensors_model_01( assert entry.disabled assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION update_entry = entity_registry.async_update_entity( - entry.entity_id, **{"disabled_by": None} + entry.entity_id, disabled_by=None ) await hass.async_block_till_done() assert update_entry != entry @@ -144,7 +144,7 @@ async def test_sensors_model_01( assert state is None update_entry = entity_registry.async_update_entity( - entry.entity_id, **{"disabled_by": None} + entry.entity_id, disabled_by=None ) await hass.async_block_till_done() async_fire_time_changed( diff --git a/tests/components/apcupsd/test_sensor.py b/tests/components/apcupsd/test_sensor.py index 77987e455c7..0c7d174a5e8 100644 --- a/tests/components/apcupsd/test_sensor.py +++ b/tests/components/apcupsd/test_sensor.py @@ -134,7 +134,7 @@ async def test_sensor_disabled( # Test enabling entity. updated_entry = entity_registry.async_update_entity( - entry.entity_id, **{"disabled_by": None} + entry.entity_id, disabled_by=None ) assert updated_entry != entry diff --git a/tests/components/apprise/test_notify.py b/tests/components/apprise/test_notify.py index ef7f878a234..c2b11ccb043 100644 --- a/tests/components/apprise/test_notify.py +++ b/tests/components/apprise/test_notify.py @@ -121,7 +121,7 @@ async def test_apprise_notification(hass: HomeAssistant) -> None: # Validate calls were made under the hood correctly obj.add.assert_called_once_with(config[BASE_COMPONENT]["url"]) obj.notify.assert_called_once_with( - **{"body": data["message"], "title": data["title"], "tag": None} + body=data["message"], title=data["title"], tag=None ) @@ -162,7 +162,7 @@ async def test_apprise_multiple_notification(hass: HomeAssistant) -> None: # Validate 2 calls were made under the hood assert obj.add.call_count == 2 obj.notify.assert_called_once_with( - **{"body": data["message"], "title": data["title"], "tag": None} + body=data["message"], title=data["title"], tag=None ) @@ -204,5 +204,5 @@ async def test_apprise_notification_with_target( # Validate calls were made under the hood correctly apprise_obj.notify.assert_called_once_with( - **{"body": data["message"], "title": data["title"], "tag": data["target"]} + body=data["message"], title=data["title"], tag=data["target"] ) diff --git a/tests/components/cloud/test_http_api.py b/tests/components/cloud/test_http_api.py index 389361693ed..0ff9fd79c75 100644 --- a/tests/components/cloud/test_http_api.py +++ b/tests/components/cloud/test_http_api.py @@ -467,19 +467,17 @@ async def test_register_view_with_location( with patch( "homeassistant.components.cloud.http_api.async_detect_location_info", return_value=LocationInfo( - **{ - "country_code": "XX", - "zip_code": "12345", - "region_code": "GH", - "ip": "1.2.3.4", - "city": "Gotham", - "region_name": "Gotham", - "time_zone": "Earth/Gotham", - "currency": "XXX", - "latitude": "12.34567", - "longitude": "12.34567", - "use_metric": True, - } + country_code="XX", + zip_code="12345", + region_code="GH", + ip="1.2.3.4", + city="Gotham", + region_name="Gotham", + time_zone="Earth/Gotham", + currency="XXX", + latitude="12.34567", + longitude="12.34567", + use_metric=True, ), ): req = await cloud_client.post( diff --git a/tests/components/fronius/__init__.py b/tests/components/fronius/__init__.py index 5f0e86c292d..3757abab928 100644 --- a/tests/components/fronius/__init__.py +++ b/tests/components/fronius/__init__.py @@ -121,7 +121,7 @@ async def enable_all_entities(hass, freezer, config_entry_id, time_till_next_upd for entry in entities if entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION ]: - registry.async_update_entity(entry.entity_id, **{"disabled_by": None}) + registry.async_update_entity(entry.entity_id, disabled_by=None) await hass.async_block_till_done() freezer.tick(time_till_next_update) async_fire_time_changed(hass) diff --git a/tests/components/hue/test_sensor_v2.py b/tests/components/hue/test_sensor_v2.py index ef13ba15235..4c1f8defc95 100644 --- a/tests/components/hue/test_sensor_v2.py +++ b/tests/components/hue/test_sensor_v2.py @@ -86,7 +86,7 @@ async def test_enable_sensor( # enable the entity updated_entry = entity_registry.async_update_entity( - entity_entry.entity_id, **{"disabled_by": None} + entity_entry.entity_id, disabled_by=None ) assert updated_entry != entity_entry assert updated_entry.disabled is False diff --git a/tests/components/lifx/test_sensor.py b/tests/components/lifx/test_sensor.py index 91000350f89..5a94963ca18 100644 --- a/tests/components/lifx/test_sensor.py +++ b/tests/components/lifx/test_sensor.py @@ -60,7 +60,7 @@ async def test_rssi_sensor( # Test enabling entity updated_entry = entity_registry.async_update_entity( - entry.entity_id, **{"disabled_by": None} + entry.entity_id, disabled_by=None ) with _patch_discovery(device=bulb), _patch_config_flow_try_connect( @@ -112,7 +112,7 @@ async def test_rssi_sensor_old_firmware( # Test enabling entity updated_entry = entity_registry.async_update_entity( - entry.entity_id, **{"disabled_by": None} + entry.entity_id, disabled_by=None ) with _patch_discovery(device=bulb), _patch_config_flow_try_connect( diff --git a/tests/components/nam/test_sensor.py b/tests/components/nam/test_sensor.py index 5a8f67c4378..44bf6552042 100644 --- a/tests/components/nam/test_sensor.py +++ b/tests/components/nam/test_sensor.py @@ -488,7 +488,7 @@ async def test_sensor_disabled( # Test enabling entity updated_entry = entity_registry.async_update_entity( - entry.entity_id, **{"disabled_by": None} + entry.entity_id, disabled_by=None ) assert updated_entry != entry diff --git a/tests/components/onewire/test_binary_sensor.py b/tests/components/onewire/test_binary_sensor.py index 5fd4ab2cee6..26b1ed5aed7 100644 --- a/tests/components/onewire/test_binary_sensor.py +++ b/tests/components/onewire/test_binary_sensor.py @@ -50,7 +50,7 @@ async def test_binary_sensors( setup_owproxy_mock_devices(owproxy, Platform.BINARY_SENSOR, [device_id]) # Some entities are disabled, enable them and reload before checking states for ent in entity_entries: - entity_registry.async_update_entity(ent.entity_id, **{"disabled_by": None}) + entity_registry.async_update_entity(ent.entity_id, disabled_by=None) await hass.config_entries.async_reload(config_entry.entry_id) await hass.async_block_till_done() diff --git a/tests/components/onewire/test_sensor.py b/tests/components/onewire/test_sensor.py index 856c3ec4dea..848489c837f 100644 --- a/tests/components/onewire/test_sensor.py +++ b/tests/components/onewire/test_sensor.py @@ -54,7 +54,7 @@ async def test_sensors( setup_owproxy_mock_devices(owproxy, Platform.SENSOR, [device_id]) # Some entities are disabled, enable them and reload before checking states for ent in entity_entries: - entity_registry.async_update_entity(ent.entity_id, **{"disabled_by": None}) + entity_registry.async_update_entity(ent.entity_id, disabled_by=None) await hass.config_entries.async_reload(config_entry.entry_id) await hass.async_block_till_done() diff --git a/tests/components/onewire/test_switch.py b/tests/components/onewire/test_switch.py index a367ace3b02..c6d84d38848 100644 --- a/tests/components/onewire/test_switch.py +++ b/tests/components/onewire/test_switch.py @@ -57,7 +57,7 @@ async def test_switches( setup_owproxy_mock_devices(owproxy, Platform.SWITCH, [device_id]) # Some entities are disabled, enable them and reload before checking states for ent in entity_entries: - entity_registry.async_update_entity(ent.entity_id, **{"disabled_by": None}) + entity_registry.async_update_entity(ent.entity_id, disabled_by=None) await hass.config_entries.async_reload(config_entry.entry_id) await hass.async_block_till_done() diff --git a/tests/components/plex/test_media_search.py b/tests/components/plex/test_media_search.py index da5b89c18eb..517fdd2f689 100644 --- a/tests/components/plex/test_media_search.py +++ b/tests/components/plex/test_media_search.py @@ -247,7 +247,7 @@ async def test_media_lookups( }, True, ) - search.assert_called_with(**{"title": "Movie 1", "libtype": None}) + search.assert_called_with(title="Movie 1", libtype=None) with pytest.raises(MediaNotFound) as excinfo: payload = '{"title": "Movie 1"}' diff --git a/tests/components/renault/test_sensor.py b/tests/components/renault/test_sensor.py index 984e974ce3b..bd94aa8d8e1 100644 --- a/tests/components/renault/test_sensor.py +++ b/tests/components/renault/test_sensor.py @@ -50,7 +50,7 @@ async def test_sensors( # Some entities are disabled, enable them and reload before checking states for ent in entity_entries: - entity_registry.async_update_entity(ent.entity_id, **{"disabled_by": None}) + entity_registry.async_update_entity(ent.entity_id, disabled_by=None) await hass.config_entries.async_reload(config_entry.entry_id) await hass.async_block_till_done() diff --git a/tests/components/sfr_box/test_sensor.py b/tests/components/sfr_box/test_sensor.py index 9d806f39be7..afdcf87b9db 100644 --- a/tests/components/sfr_box/test_sensor.py +++ b/tests/components/sfr_box/test_sensor.py @@ -46,7 +46,7 @@ async def test_sensors( # Some entities are disabled, enable them and reload before checking states for ent in entity_entries: - entity_registry.async_update_entity(ent.entity_id, **{"disabled_by": None}) + entity_registry.async_update_entity(ent.entity_id, disabled_by=None) await hass.config_entries.async_reload(config_entry.entry_id) await hass.async_block_till_done() diff --git a/tests/components/signal_messenger/test_notify.py b/tests/components/signal_messenger/test_notify.py index d1f590ab5bc..87b51bdef7c 100644 --- a/tests/components/signal_messenger/test_notify.py +++ b/tests/components/signal_messenger/test_notify.py @@ -92,7 +92,7 @@ def test_send_message_with_bad_data_throws_vol_error( logging.DEBUG, logger="homeassistant.components.signal_messenger.notify" ), pytest.raises(vol.Invalid) as exc: data = {"test": "test"} - signal_notification_service.send_message(MESSAGE, **{"data": data}) + signal_notification_service.send_message(MESSAGE, data=data) assert "Sending signal message" in caplog.text assert "extra keys not allowed" in str(exc.value) @@ -112,7 +112,7 @@ def test_send_message_with_attachment( ) as temp_file: temp_file.write("attachment_data") data = {"attachments": [temp_file.name]} - signal_notification_service.send_message(MESSAGE, **{"data": data}) + signal_notification_service.send_message(MESSAGE, data=data) assert "Sending signal message" in caplog.text assert signal_requests_mock.called @@ -131,7 +131,7 @@ def test_send_message_with_attachment_as_url( logging.DEBUG, logger="homeassistant.components.signal_messenger.notify" ): data = {"urls": [URL_ATTACHMENT]} - signal_notification_service.send_message(MESSAGE, **{"data": data}) + signal_notification_service.send_message(MESSAGE, data=data) assert "Sending signal message" in caplog.text assert signal_requests_mock.called diff --git a/tests/components/switcher_kis/test_sensor.py b/tests/components/switcher_kis/test_sensor.py index 99bc0aa3a69..f61cdd5a010 100644 --- a/tests/components/switcher_kis/test_sensor.py +++ b/tests/components/switcher_kis/test_sensor.py @@ -66,9 +66,7 @@ async def test_sensor_disabled(hass: HomeAssistant, mock_bridge) -> None: assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION # Test enabling entity - updated_entry = registry.async_update_entity( - entry.entity_id, **{"disabled_by": None} - ) + updated_entry = registry.async_update_entity(entry.entity_id, disabled_by=None) assert updated_entry != entry assert updated_entry.disabled is False diff --git a/tests/components/tomorrowio/test_sensor.py b/tests/components/tomorrowio/test_sensor.py index 0b5b989b91a..b0e2fba3123 100644 --- a/tests/components/tomorrowio/test_sensor.py +++ b/tests/components/tomorrowio/test_sensor.py @@ -105,9 +105,7 @@ def _enable_entity(hass: HomeAssistant, entity_name: str) -> None: """Enable disabled entity.""" ent_reg = async_get(hass) entry = ent_reg.async_get(entity_name) - updated_entry = ent_reg.async_update_entity( - entry.entity_id, **{"disabled_by": None} - ) + updated_entry = ent_reg.async_update_entity(entry.entity_id, disabled_by=None) assert updated_entry != entry assert updated_entry.disabled is False diff --git a/tests/components/tomorrowio/test_weather.py b/tests/components/tomorrowio/test_weather.py index dbb94dcd89b..a87c0363b7a 100644 --- a/tests/components/tomorrowio/test_weather.py +++ b/tests/components/tomorrowio/test_weather.py @@ -68,9 +68,7 @@ def _enable_entity(hass: HomeAssistant, entity_name: str) -> None: """Enable disabled entity.""" ent_reg = async_get(hass) entry = ent_reg.async_get(entity_name) - updated_entry = ent_reg.async_update_entity( - entry.entity_id, **{"disabled_by": None} - ) + updated_entry = ent_reg.async_update_entity(entry.entity_id, disabled_by=None) assert updated_entry != entry assert updated_entry.disabled is False diff --git a/tests/components/xiaomi_miio/test_vacuum.py b/tests/components/xiaomi_miio/test_vacuum.py index a020b4bf8e9..c5345386777 100644 --- a/tests/components/xiaomi_miio/test_vacuum.py +++ b/tests/components/xiaomi_miio/test_vacuum.py @@ -372,13 +372,7 @@ async def test_xiaomi_vacuum_services( "velocity": -0.1, }, "manual_control", - mock.call( - **{ - "duration": 1000, - "rotation": -40, - "velocity": -0.1, - } - ), + mock.call(duration=1000, rotation=-40, velocity=-0.1), ), ( SERVICE_STOP_REMOTE_CONTROL, @@ -397,13 +391,7 @@ async def test_xiaomi_vacuum_services( "velocity": 0.1, }, "manual_control_once", - mock.call( - **{ - "duration": 2000, - "rotation": 120, - "velocity": 0.1, - } - ), + mock.call(duration=2000, rotation=120, velocity=0.1), ), ( SERVICE_CLEAN_ZONE, diff --git a/tests/components/zwave_js/test_binary_sensor.py b/tests/components/zwave_js/test_binary_sensor.py index 61ceb82263e..3f78e23a50c 100644 --- a/tests/components/zwave_js/test_binary_sensor.py +++ b/tests/components/zwave_js/test_binary_sensor.py @@ -119,9 +119,7 @@ async def test_disabled_legacy_sensor( assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION # Test enabling legacy entity - updated_entry = registry.async_update_entity( - entry.entity_id, **{"disabled_by": None} - ) + updated_entry = registry.async_update_entity(entry.entity_id, disabled_by=None) assert updated_entry != entry assert updated_entry.disabled is False @@ -274,7 +272,7 @@ async def test_config_parameter_binary_sensor( assert entity_entry.entity_category == EntityCategory.DIAGNOSTIC updated_entry = ent_reg.async_update_entity( - binary_sensor_entity_id, **{"disabled_by": None} + binary_sensor_entity_id, disabled_by=None ) assert updated_entry != entity_entry assert updated_entry.disabled is False diff --git a/tests/components/zwave_js/test_device_trigger.py b/tests/components/zwave_js/test_device_trigger.py index 0835ef01162..93402219b6c 100644 --- a/tests/components/zwave_js/test_device_trigger.py +++ b/tests/components/zwave_js/test_device_trigger.py @@ -341,7 +341,7 @@ async def test_get_node_status_triggers( entity_id = async_get_node_status_sensor_entity_id( hass, device.id, ent_reg, dev_reg ) - entity = ent_reg.async_update_entity(entity_id, **{"disabled_by": None}) + entity = ent_reg.async_update_entity(entity_id, disabled_by=None) await hass.config_entries.async_reload(integration.entry_id) await hass.async_block_till_done() @@ -373,7 +373,7 @@ async def test_if_node_status_change_fires( entity_id = async_get_node_status_sensor_entity_id( hass, device.id, ent_reg, dev_reg ) - entity = ent_reg.async_update_entity(entity_id, **{"disabled_by": None}) + entity = ent_reg.async_update_entity(entity_id, disabled_by=None) await hass.config_entries.async_reload(integration.entry_id) await hass.async_block_till_done() @@ -452,7 +452,7 @@ async def test_if_node_status_change_fires_legacy( entity_id = async_get_node_status_sensor_entity_id( hass, device.id, ent_reg, dev_reg ) - ent_reg.async_update_entity(entity_id, **{"disabled_by": None}) + ent_reg.async_update_entity(entity_id, disabled_by=None) await hass.config_entries.async_reload(integration.entry_id) await hass.async_block_till_done() @@ -530,7 +530,7 @@ async def test_get_trigger_capabilities_node_status( entity_id = async_get_node_status_sensor_entity_id( hass, device.id, ent_reg, dev_reg ) - ent_reg.async_update_entity(entity_id, **{"disabled_by": None}) + ent_reg.async_update_entity(entity_id, disabled_by=None) await hass.config_entries.async_reload(integration.entry_id) await hass.async_block_till_done() diff --git a/tests/components/zwave_js/test_discovery.py b/tests/components/zwave_js/test_discovery.py index 2b597339e8f..fe231707629 100644 --- a/tests/components/zwave_js/test_discovery.py +++ b/tests/components/zwave_js/test_discovery.py @@ -153,9 +153,7 @@ async def test_merten_507801_disabled_enitites( assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION # Test enabling entity - updated_entry = registry.async_update_entity( - entry.entity_id, **{"disabled_by": None} - ) + updated_entry = registry.async_update_entity(entry.entity_id, disabled_by=None) assert updated_entry != entry assert updated_entry.disabled is False diff --git a/tests/components/zwave_js/test_number.py b/tests/components/zwave_js/test_number.py index e05346b442a..38a582762cb 100644 --- a/tests/components/zwave_js/test_number.py +++ b/tests/components/zwave_js/test_number.py @@ -232,7 +232,7 @@ async def test_config_parameter_number( assert entity_entry.entity_category == EntityCategory.CONFIG for entity_id in (number_entity_id, number_with_states_entity_id): - updated_entry = ent_reg.async_update_entity(entity_id, **{"disabled_by": None}) + updated_entry = ent_reg.async_update_entity(entity_id, disabled_by=None) assert updated_entry != entity_entry assert updated_entry.disabled is False diff --git a/tests/components/zwave_js/test_select.py b/tests/components/zwave_js/test_select.py index ee2d14cfcba..f1a1f8796d0 100644 --- a/tests/components/zwave_js/test_select.py +++ b/tests/components/zwave_js/test_select.py @@ -308,9 +308,7 @@ async def test_config_parameter_select( assert entity_entry.disabled assert entity_entry.entity_category == EntityCategory.CONFIG - updated_entry = ent_reg.async_update_entity( - select_entity_id, **{"disabled_by": None} - ) + updated_entry = ent_reg.async_update_entity(select_entity_id, disabled_by=None) assert updated_entry != entity_entry assert updated_entry.disabled is False diff --git a/tests/components/zwave_js/test_sensor.py b/tests/components/zwave_js/test_sensor.py index 2ae4dc7686a..417b57aaaaa 100644 --- a/tests/components/zwave_js/test_sensor.py +++ b/tests/components/zwave_js/test_sensor.py @@ -222,7 +222,7 @@ async def test_disabled_notification_sensor( # Test enabling entity updated_entry = ent_reg.async_update_entity( - entity_entry.entity_id, **{"disabled_by": None} + entity_entry.entity_id, disabled_by=None ) assert updated_entry != entity_entry assert updated_entry.disabled is False @@ -278,7 +278,7 @@ async def test_config_parameter_sensor( assert entity_entry.entity_category == EntityCategory.DIAGNOSTIC for entity_id in (sensor_entity_id, sensor_with_states_entity_id): - updated_entry = ent_reg.async_update_entity(entity_id, **{"disabled_by": None}) + updated_entry = ent_reg.async_update_entity(entity_id, disabled_by=None) assert updated_entry != entity_entry assert updated_entry.disabled is False @@ -295,7 +295,7 @@ async def test_config_parameter_sensor( assert state.state == "C-Wire" updated_entry = ent_reg.async_update_entity( - entity_entry.entity_id, **{"disabled_by": None} + entity_entry.entity_id, disabled_by=None ) assert updated_entry != entity_entry assert updated_entry.disabled is False @@ -753,7 +753,7 @@ async def test_statistics_sensors_no_last_seen( assert entry.disabled assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION - ent_reg.async_update_entity(entry.entity_id, **{"disabled_by": None}) + ent_reg.async_update_entity(entry.entity_id, disabled_by=None) # reload integration and check if entity is correctly there await hass.config_entries.async_reload(integration.entry_id) diff --git a/tests/components/zwave_js/test_switch.py b/tests/components/zwave_js/test_switch.py index e9ffdef55cb..5a5ad0821eb 100644 --- a/tests/components/zwave_js/test_switch.py +++ b/tests/components/zwave_js/test_switch.py @@ -228,9 +228,7 @@ async def test_config_parameter_switch( assert entity_entry assert entity_entry.disabled - updated_entry = ent_reg.async_update_entity( - switch_entity_id, **{"disabled_by": None} - ) + updated_entry = ent_reg.async_update_entity(switch_entity_id, disabled_by=None) assert updated_entry != entity_entry assert updated_entry.disabled is False assert entity_entry.entity_category == EntityCategory.CONFIG diff --git a/tests/test_config.py b/tests/test_config.py index 13bb1519876..56e63cc40c7 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1971,7 +1971,7 @@ async def test_core_store_historic_currency( assert issue assert issue.translation_placeholders == {"currency": "LTT"} - await hass.config.async_update(**{"currency": "EUR"}) + await hass.config.async_update(currency="EUR") issue = issue_registry.async_get_issue("homeassistant", issue_id) assert not issue @@ -2027,7 +2027,7 @@ async def test_core_store_no_country( issue = issue_registry.async_get_issue("homeassistant", issue_id) assert issue - await hass.config.async_update(**{"country": "SE"}) + await hass.config.async_update(country="SE") issue = issue_registry.async_get_issue("homeassistant", issue_id) assert not issue