mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Minor cleanup of Zimi Integration (#144293)
This commit is contained in:
parent
9ec02633b3
commit
6e44552d41
@ -51,7 +51,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ZimiConfigEntry) -> bool
|
||||
config_entry_id=entry.entry_id,
|
||||
identifiers={(DOMAIN, api.mac)},
|
||||
manufacturer=api.brand,
|
||||
name=f"{api.network_name}",
|
||||
name=api.network_name,
|
||||
model="Zimi Cloud Connect",
|
||||
sw_version=api.firmware_version,
|
||||
connections={(CONNECTION_NETWORK_MAC, api.mac)},
|
||||
|
@ -32,7 +32,7 @@ async def async_setup_entry(
|
||||
]
|
||||
|
||||
lights.extend(
|
||||
[ZimiDimmer(device, api) for device in api.lights if device.type == "dimmer"]
|
||||
ZimiDimmer(device, api) for device in api.lights if device.type == "dimmer"
|
||||
)
|
||||
|
||||
async_add_entities(lights)
|
||||
@ -81,8 +81,6 @@ class ZimiDimmer(ZimiLight):
|
||||
super().__init__(device, api)
|
||||
self._attr_color_mode = ColorMode.BRIGHTNESS
|
||||
self._attr_supported_color_modes = {ColorMode.BRIGHTNESS}
|
||||
if self._device.type != "dimmer":
|
||||
raise ValueError("ZimiDimmer needs a dimmable light")
|
||||
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
"""Instruct the light to turn on (with optional brightness)."""
|
||||
|
@ -63,6 +63,10 @@ async def test_user_discovery_success(
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.CREATE_ENTRY
|
||||
assert result["context"] == {
|
||||
"source": config_entries.SOURCE_USER,
|
||||
"unique_id": INPUT_MAC,
|
||||
}
|
||||
assert result["data"] == {
|
||||
"host": INPUT_HOST,
|
||||
"port": INPUT_PORT,
|
||||
|
Loading…
x
Reference in New Issue
Block a user