mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-18 09:44:05 +02:00
Fix pre-commit issues
This commit is contained in:
parent
166044074a
commit
6b3686696b
2 changed files with 3 additions and 3 deletions
|
|
@ -169,12 +169,14 @@ BRIGHTNESS_ATTRS = {
|
|||
# Keep a short domain version for the context instances (which can only be 36 chars)
|
||||
_DOMAIN_SHORT = "adapt_lgt"
|
||||
|
||||
|
||||
def _int_to_bytes(i: int, signed: bool = False) -> bytes:
|
||||
bits = i.bit_length()
|
||||
if signed:
|
||||
# Make room for the sign bit.
|
||||
bits += 1
|
||||
return i.to_bytes((bits + 7) // 8, 'little', signed=signed)
|
||||
return i.to_bytes((bits + 7) // 8, "little", signed=signed)
|
||||
|
||||
|
||||
def _short_hash(string: str, length: int = 4) -> str:
|
||||
"""Create a hash of 'string' with length 'length'."""
|
||||
|
|
|
|||
|
|
@ -33,13 +33,11 @@ from homeassistant.components.adaptive_lighting.const import (
|
|||
)
|
||||
from homeassistant.components.adaptive_lighting.switch import (
|
||||
_attributes_have_changed,
|
||||
_expand_light_groups,
|
||||
color_difference_redmean,
|
||||
create_context,
|
||||
is_our_context,
|
||||
)
|
||||
from homeassistant.components.demo.light import DemoLight
|
||||
from homeassistant.components.group import DOMAIN as GROUP_DOMAIN
|
||||
from homeassistant.components.light import (
|
||||
ATTR_BRIGHTNESS,
|
||||
ATTR_BRIGHTNESS_PCT,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue