Enable more SIM ruff rules (#113015)

* SIM101 SIM103

* SIM107 SIM109

* SIM110

* SIM112 SIM113

* SIM115

* SIM116

* Fix

* Fix

* Fix
This commit is contained in:
Joost Lekkerkerker 2024-03-11 04:20:37 +01:00 committed by GitHub
parent e96ef4613c
commit cddce0ce0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 41 additions and 70 deletions

View file

@ -37,9 +37,7 @@ async def test_wait_time_select(
data = {ATTR_ENTITY_ID: SELECT_ENTITY_ID}
count = 0
for wait_time in LitterRobot3.VALID_WAIT_TIMES:
count += 1
for count, wait_time in enumerate(LitterRobot3.VALID_WAIT_TIMES):
data[ATTR_OPTION] = wait_time
await hass.services.async_call(
@ -49,7 +47,7 @@ async def test_wait_time_select(
blocking=True,
)
assert mock_account.robots[0].set_wait_time.call_count == count
assert mock_account.robots[0].set_wait_time.call_count == count + 1
async def test_invalid_wait_time_select(hass: HomeAssistant, mock_account) -> None:
@ -91,9 +89,8 @@ async def test_panel_brightness_select(
robot: LitterRobot4 = mock_account_with_litterrobot_4.robots[0]
robot.set_panel_brightness = AsyncMock(return_value=True)
count = 0
for option in select.attributes[ATTR_OPTIONS]:
count += 1
for count, option in enumerate(select.attributes[ATTR_OPTIONS]):
data[ATTR_OPTION] = option
await hass.services.async_call(
@ -103,4 +100,4 @@ async def test_panel_brightness_select(
blocking=True,
)
assert robot.set_panel_brightness.call_count == count
assert robot.set_panel_brightness.call_count == count + 1