mirror of
https://github.com/home-assistant/core.git
synced 2026-11-06 13:41:27 -04:00
Improve (r)split performance (#162418)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user