Move overlapping pylint rules to ruff, disable mypy overlap (#94359)

This commit is contained in:
Franck Nijhof 2023-06-27 17:42:46 +02:00 committed by GitHub
parent 7c676c0a7d
commit 3e85a29b86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
88 changed files with 537 additions and 357 deletions

View file

@ -96,29 +96,26 @@ class IhcLight(IHCDevice, LightEntity):
"""Turn the light on."""
if ATTR_BRIGHTNESS in kwargs:
brightness = kwargs[ATTR_BRIGHTNESS]
else:
if (brightness := self._brightness) == 0:
brightness = 255
elif (brightness := self._brightness) == 0:
brightness = 255
if self._dimmable:
await async_set_int(
self.hass, self.ihc_controller, self.ihc_id, int(brightness * 100 / 255)
)
elif self._ihc_on_id:
await async_pulse(self.hass, self.ihc_controller, self._ihc_on_id)
else:
if self._ihc_on_id:
await async_pulse(self.hass, self.ihc_controller, self._ihc_on_id)
else:
await async_set_bool(self.hass, self.ihc_controller, self.ihc_id, True)
await async_set_bool(self.hass, self.ihc_controller, self.ihc_id, True)
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the light off."""
if self._dimmable:
await async_set_int(self.hass, self.ihc_controller, self.ihc_id, 0)
elif self._ihc_off_id:
await async_pulse(self.hass, self.ihc_controller, self._ihc_off_id)
else:
if self._ihc_off_id:
await async_pulse(self.hass, self.ihc_controller, self._ihc_off_id)
else:
await async_set_bool(self.hass, self.ihc_controller, self.ihc_id, False)
await async_set_bool(self.hass, self.ihc_controller, self.ihc_id, False)
def on_ihc_change(self, ihc_id, value):
"""Handle IHC notifications."""