Skip to content

Commit

Permalink
Use supported color modes in Axis integration (home-assistant#51557)
Browse files Browse the repository at this point in the history
* Use supported color modes in Axis integration

* Fix Frencks comments

* Do Frencks suggestion
  • Loading branch information
Kane610 authored Jun 7, 2021
1 parent 76edfe6 commit aad90b8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions homeassistant/components/axis/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from homeassistant.components.light import (
ATTR_BRIGHTNESS,
SUPPORT_BRIGHTNESS,
COLOR_MODE_BRIGHTNESS,
LightEntity,
)
from homeassistant.core import callback
Expand Down Expand Up @@ -49,7 +49,8 @@ def __init__(self, event, device):
self.current_intensity = 0
self.max_intensity = 0

self._features = SUPPORT_BRIGHTNESS
self._attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
self._attr_color_mode = COLOR_MODE_BRIGHTNESS

async def async_added_to_hass(self) -> None:
"""Subscribe lights events."""
Expand All @@ -67,11 +68,6 @@ async def async_added_to_hass(self) -> None:
)
self.max_intensity = max_intensity["data"]["ranges"][0]["high"]

@property
def supported_features(self):
"""Flag supported features."""
return self._features

@property
def name(self):
"""Return the name of the light."""
Expand Down

0 comments on commit aad90b8

Please sign in to comment.