Improve (r)split performance (#162418)

This commit is contained in:
epenet
2026-02-06 15:10:30 +01:00
committed by GitHub
parent 5ad632c34a
commit bc1c24efb1
18 changed files with 24 additions and 22 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ async def test_buttons_containers_exceptions(
"""Test that Portainer buttons, but this time when they will do boom for sure."""
await setup_integration(hass, mock_config_entry)
action = client_method.split("_")[0]
action = client_method.split("_", maxsplit=1)[0]
entity_id = f"button.practical_morse_{action}_container"
method_mock = getattr(mock_portainer_client, client_method)
+1 -1
View File
@@ -295,7 +295,7 @@ class SoCoMockFactory:
# Generate a different MAC for the non-default speakers.
# otherwise new devices will not be created.
if ip_address != "192.168.42.2":
last_octet = ip_address.split(".")[-1]
last_octet = ip_address.rsplit(".", maxsplit=1)[-1]
my_speaker_info["mac_address"] = f"00-00-00-00-00-{last_octet.zfill(2)}"
mock_soco.get_speaker_info = Mock(return_value=my_speaker_info)
mock_soco.add_to_queue = Mock(return_value=10)