-
-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize yeelight specs file (#1166)
* Reorganizing information in a specs file * remove unused * Fix typo * night_light was moved to device scope * move main light spec on the top level
- Loading branch information
Showing
4 changed files
with
98 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,180 +1,159 @@ | ||
yeelink.light.bslamp1: | ||
color_temp: [1700, 6500] | ||
night_light: False | ||
background_light: False | ||
color_temp: [1700, 6500] | ||
supports_color: True | ||
yeelink.light.bslamp2: | ||
color_temp: [1700, 6500] | ||
night_light: True | ||
background_light: False | ||
color_temp: [1700, 6500] | ||
supports_color: True | ||
yeelink.light.bslamp3: | ||
color_temp: [1700, 6500] | ||
night_light: True | ||
background_light: False | ||
color_temp: [1700, 6500] | ||
supports_color: True | ||
yeelink.light.ceil26: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
yeelink.light.ceila: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
yeelink.light.ceiling1: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
yeelink.light.ceiling2: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
yeelink.light.ceiling3: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
yeelink.light.ceiling4: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: True | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
background: | ||
color_temp: [1700, 6500] | ||
supports_color: True | ||
yeelink.light.ceiling5: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
yeelink.light.ceiling6: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
yeelink.light.ceiling10: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: True | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
background: | ||
color_temp: [1700, 6500] | ||
supports_color: True | ||
yeelink.light.ceiling13: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
yeelink.light.ceiling15: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
yeelink.light.ceiling18: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
yeelink.light.ceiling19: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: True | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
background: | ||
color_temp: [1700, 6500] | ||
supports_color: True | ||
yeelink.light.ceiling20: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: True | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
background: | ||
color_temp: [1700, 6500] | ||
supports_color: True | ||
yeelink.light.ceiling22: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
yeelink.light.ceiling24: | ||
color_temp: [2700, 6500] | ||
night_light: True | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
yeelink.light.color1: | ||
color_temp: [1700, 6500] | ||
night_light: False | ||
background_light: False | ||
color_temp: [1700, 6500] | ||
supports_color: True | ||
yeelink.light.color2: | ||
color_temp: [2700, 6500] | ||
night_light: False | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: True | ||
yeelink.light.color4: | ||
color_temp: [1700, 6500] | ||
night_light: False | ||
background_light: False | ||
color_temp: [1700, 6500] | ||
supports_color: True | ||
yeelink.light.colorc: | ||
color_temp: [2700, 6500] | ||
night_light: False | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: True | ||
yeelink.light.color: | ||
color_temp: [1700, 6500] | ||
night_light: False | ||
background_light: False | ||
color_temp: [1700, 6500] | ||
supports_color: True | ||
yeelink.light.ct_bulb: | ||
color_temp: [2700, 6500] | ||
night_light: False | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
yeelink.light.ct2: | ||
color_temp: [2700, 6500] | ||
night_light: False | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
yeelink.light.lamp1: | ||
color_temp: [2700, 5000] | ||
night_light: False | ||
background_light: False | ||
color_temp: [2700, 5000] | ||
supports_color: False | ||
yeelink.light.lamp4: | ||
color_temp: [2600, 5000] | ||
night_light: False | ||
background_light: False | ||
color_temp: [2600, 5000] | ||
supports_color: False | ||
yeelink.light.lamp15: | ||
color_temp: [2700, 6500] | ||
night_light: False | ||
background_light: True | ||
color_temp: [2700, 6500] | ||
supports_color: False | ||
background: | ||
color_temp: [1700, 6500] | ||
supports_color: True | ||
yeelink.light.mono1: | ||
color_temp: [2700, 2700] | ||
night_light: False | ||
background_light: False | ||
color_temp: [2700, 2700] | ||
supports_color: False | ||
yeelink.light.mono5: | ||
color_temp: [2700, 2700] | ||
night_light: False | ||
background_light: False | ||
color_temp: [2700, 2700] | ||
supports_color: False | ||
yeelink.light.mono: | ||
color_temp: [2700, 2700] | ||
night_light: False | ||
background_light: False | ||
color_temp: [2700, 2700] | ||
supports_color: False | ||
yeelink.light.monob: | ||
color_temp: [2700, 2700] | ||
night_light: False | ||
background_light: False | ||
color_temp: [2700, 2700] | ||
supports_color: False | ||
yeelink.light.strip1: | ||
color_temp: [1700, 6500] | ||
night_light: False | ||
background_light: False | ||
color_temp: [1700, 6500] | ||
supports_color: True | ||
yeelink.light.strip2: | ||
color_temp: [2700, 6500] | ||
night_light: False | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: True | ||
yeelink.light.strip4: | ||
color_temp: [2700, 6500] | ||
night_light: False | ||
background_light: False | ||
color_temp: [2700, 6500] | ||
supports_color: True |
18 changes: 11 additions & 7 deletions
18
miio/integrations/yeelight/tests/test_yeelight_spec_helper.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
from ..spec_helper import ColorTempRange, YeelightSpecHelper | ||
from ..spec_helper import ColorTempRange, YeelightSpecHelper, YeelightSubLightType | ||
|
||
|
||
def test_get_model_info(): | ||
spec_helper = YeelightSpecHelper() | ||
model_info = spec_helper.get_model_info("yeelink.light.bslamp1") | ||
assert model_info.model == "yeelink.light.bslamp1" | ||
assert model_info.color_temp == ColorTempRange(1700, 6500) | ||
assert model_info.night_light is False | ||
assert model_info.background_light is False | ||
assert model_info.supports_color is True | ||
assert model_info.lamps[YeelightSubLightType.Main].color_temp == ColorTempRange( | ||
1700, 6500 | ||
) | ||
assert model_info.lamps[YeelightSubLightType.Main].supports_color is True | ||
assert YeelightSubLightType.Background not in model_info.lamps | ||
|
||
|
||
def test_get_unknown_model_info(): | ||
spec_helper = YeelightSpecHelper() | ||
model_info = spec_helper.get_model_info("notreal") | ||
assert model_info.model == "generic" | ||
assert model_info.color_temp == ColorTempRange(1700, 6500) | ||
assert model_info.night_light is False | ||
assert model_info.background_light is False | ||
assert model_info.supports_color is False | ||
assert model_info.lamps[YeelightSubLightType.Main].color_temp == ColorTempRange( | ||
1700, 6500 | ||
) | ||
assert model_info.lamps[YeelightSubLightType.Main].supports_color is False | ||
assert YeelightSubLightType.Background not in model_info.lamps |