mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 01:08:12 +00:00
Govee light local bump (#137436)
This commit is contained in:
parent
4694240cfa
commit
830636df07
@ -5,7 +5,7 @@ from __future__ import annotations
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
from govee_local_api import GoveeDevice, GoveeLightCapability
|
||||
from govee_local_api import GoveeDevice, GoveeLightFeatures
|
||||
|
||||
from homeassistant.components.light import (
|
||||
ATTR_BRIGHTNESS,
|
||||
@ -71,13 +71,13 @@ class GoveeLight(CoordinatorEntity[GoveeLocalApiCoordinator], LightEntity):
|
||||
capabilities = device.capabilities
|
||||
color_modes = {ColorMode.ONOFF}
|
||||
if capabilities:
|
||||
if GoveeLightCapability.COLOR_RGB in capabilities:
|
||||
if GoveeLightFeatures.COLOR_RGB & capabilities.features:
|
||||
color_modes.add(ColorMode.RGB)
|
||||
if GoveeLightCapability.COLOR_KELVIN_TEMPERATURE in capabilities:
|
||||
if GoveeLightFeatures.COLOR_KELVIN_TEMPERATURE & capabilities.features:
|
||||
color_modes.add(ColorMode.COLOR_TEMP)
|
||||
self._attr_max_color_temp_kelvin = 9000
|
||||
self._attr_min_color_temp_kelvin = 2000
|
||||
if GoveeLightCapability.BRIGHTNESS in capabilities:
|
||||
if GoveeLightFeatures.BRIGHTNESS & capabilities.features:
|
||||
color_modes.add(ColorMode.BRIGHTNESS)
|
||||
|
||||
self._attr_supported_color_modes = filter_supported_color_modes(color_modes)
|
||||
|
@ -6,5 +6,5 @@
|
||||
"dependencies": ["network"],
|
||||
"documentation": "https://www.home-assistant.io/integrations/govee_light_local",
|
||||
"iot_class": "local_push",
|
||||
"requirements": ["govee-local-api==1.5.3"]
|
||||
"requirements": ["govee-local-api==2.0.0"]
|
||||
}
|
||||
|
2
requirements_all.txt
generated
2
requirements_all.txt
generated
@ -1055,7 +1055,7 @@ gotailwind==0.3.0
|
||||
govee-ble==0.42.1
|
||||
|
||||
# homeassistant.components.govee_light_local
|
||||
govee-local-api==1.5.3
|
||||
govee-local-api==2.0.0
|
||||
|
||||
# homeassistant.components.remote_rpi_gpio
|
||||
gpiozero==1.6.2
|
||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@ -905,7 +905,7 @@ gotailwind==0.3.0
|
||||
govee-ble==0.42.1
|
||||
|
||||
# homeassistant.components.govee_light_local
|
||||
govee-local-api==1.5.3
|
||||
govee-local-api==2.0.0
|
||||
|
||||
# homeassistant.components.gpsd
|
||||
gps3==0.33.3
|
||||
|
@ -4,7 +4,8 @@ from asyncio import Event
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
from govee_local_api import GoveeLightCapability
|
||||
from govee_local_api import GoveeLightCapabilities
|
||||
from govee_local_api.light_capabilities import COMMON_FEATURES
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.govee_light_local.coordinator import GoveeController
|
||||
@ -34,8 +35,6 @@ def fixture_mock_setup_entry() -> Generator[AsyncMock]:
|
||||
yield mock_setup_entry
|
||||
|
||||
|
||||
DEFAULT_CAPABILITEIS: set[GoveeLightCapability] = {
|
||||
GoveeLightCapability.COLOR_RGB,
|
||||
GoveeLightCapability.COLOR_KELVIN_TEMPERATURE,
|
||||
GoveeLightCapability.BRIGHTNESS,
|
||||
}
|
||||
DEFAULT_CAPABILITIES: GoveeLightCapabilities = GoveeLightCapabilities(
|
||||
features=COMMON_FEATURES, segments=[], scenes={}
|
||||
)
|
||||
|
@ -10,7 +10,7 @@ from homeassistant.components.govee_light_local.const import DOMAIN
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.data_entry_flow import FlowResultType
|
||||
|
||||
from .conftest import DEFAULT_CAPABILITEIS
|
||||
from .conftest import DEFAULT_CAPABILITIES
|
||||
|
||||
|
||||
def _get_devices(mock_govee_api: AsyncMock) -> list[GoveeDevice]:
|
||||
@ -20,7 +20,7 @@ def _get_devices(mock_govee_api: AsyncMock) -> list[GoveeDevice]:
|
||||
ip="192.168.1.100",
|
||||
fingerprint="asdawdqwdqwd1",
|
||||
sku="H615A",
|
||||
capabilities=DEFAULT_CAPABILITEIS,
|
||||
capabilities=DEFAULT_CAPABILITIES,
|
||||
)
|
||||
]
|
||||
|
||||
|
@ -10,7 +10,7 @@ from homeassistant.components.light import ATTR_SUPPORTED_COLOR_MODES, ColorMode
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from .conftest import DEFAULT_CAPABILITEIS
|
||||
from .conftest import DEFAULT_CAPABILITIES
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
@ -26,7 +26,7 @@ async def test_light_known_device(
|
||||
ip="192.168.1.100",
|
||||
fingerprint="asdawdqwdqwd",
|
||||
sku="H615A",
|
||||
capabilities=DEFAULT_CAPABILITEIS,
|
||||
capabilities=DEFAULT_CAPABILITIES,
|
||||
)
|
||||
]
|
||||
|
||||
@ -96,7 +96,7 @@ async def test_light_remove(hass: HomeAssistant, mock_govee_api: AsyncMock) -> N
|
||||
ip="192.168.1.100",
|
||||
fingerprint="asdawdqwdqwd1",
|
||||
sku="H615A",
|
||||
capabilities=DEFAULT_CAPABILITEIS,
|
||||
capabilities=DEFAULT_CAPABILITIES,
|
||||
)
|
||||
]
|
||||
|
||||
@ -152,7 +152,7 @@ async def test_light_setup_retry_eaddrinuse(
|
||||
ip="192.168.1.100",
|
||||
fingerprint="asdawdqwdqwd",
|
||||
sku="H615A",
|
||||
capabilities=DEFAULT_CAPABILITEIS,
|
||||
capabilities=DEFAULT_CAPABILITIES,
|
||||
)
|
||||
]
|
||||
|
||||
@ -180,7 +180,7 @@ async def test_light_setup_error(
|
||||
ip="192.168.1.100",
|
||||
fingerprint="asdawdqwdqwd",
|
||||
sku="H615A",
|
||||
capabilities=DEFAULT_CAPABILITEIS,
|
||||
capabilities=DEFAULT_CAPABILITIES,
|
||||
)
|
||||
]
|
||||
|
||||
@ -204,7 +204,7 @@ async def test_light_on_off(hass: HomeAssistant, mock_govee_api: MagicMock) -> N
|
||||
ip="192.168.1.100",
|
||||
fingerprint="asdawdqwdqwd",
|
||||
sku="H615A",
|
||||
capabilities=DEFAULT_CAPABILITEIS,
|
||||
capabilities=DEFAULT_CAPABILITIES,
|
||||
)
|
||||
]
|
||||
|
||||
@ -260,7 +260,7 @@ async def test_light_brightness(hass: HomeAssistant, mock_govee_api: MagicMock)
|
||||
ip="192.168.1.100",
|
||||
fingerprint="asdawdqwdqwd",
|
||||
sku="H615A",
|
||||
capabilities=DEFAULT_CAPABILITEIS,
|
||||
capabilities=DEFAULT_CAPABILITIES,
|
||||
)
|
||||
]
|
||||
|
||||
@ -335,7 +335,7 @@ async def test_light_color(hass: HomeAssistant, mock_govee_api: MagicMock) -> No
|
||||
ip="192.168.1.100",
|
||||
fingerprint="asdawdqwdqwd",
|
||||
sku="H615A",
|
||||
capabilities=DEFAULT_CAPABILITEIS,
|
||||
capabilities=DEFAULT_CAPABILITIES,
|
||||
)
|
||||
]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user