Check for attribute existence for HS220 support (#21309)
* Check for attribute existence as smartplug does not have them (for HS220 support) * use getattr over hasattr and a separate check
This commit is contained in:
parent
1eba90d2a1
commit
492c3b24de
1 changed files with 2 additions and 2 deletions
|
@ -222,11 +222,11 @@ class TPLinkSmartBulb(Light):
|
|||
|
||||
if self.smartbulb.is_dimmable:
|
||||
self._supported_features += SUPPORT_BRIGHTNESS
|
||||
if self.smartbulb.is_variable_color_temp:
|
||||
if getattr(self.smartbulb, 'is_variable_color_temp', False):
|
||||
self._supported_features += SUPPORT_COLOR_TEMP
|
||||
self._min_mireds = kelvin_to_mired(
|
||||
self.smartbulb.valid_temperature_range[1])
|
||||
self._max_mireds = kelvin_to_mired(
|
||||
self.smartbulb.valid_temperature_range[0])
|
||||
if self.smartbulb.is_color:
|
||||
if getattr(self.smartbulb, 'is_color', False):
|
||||
self._supported_features += SUPPORT_COLOR
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue