mirror of
https://github.com/esphome/esphome.git
synced 2025-09-03 11:52:20 +01:00
Merge branch 'dev' into vornado-ir
This commit is contained in:
@@ -6,7 +6,6 @@ light:
|
||||
rgb_order: GRB
|
||||
num_leds: 256
|
||||
pin: 2
|
||||
rmt_channel: 0
|
||||
|
||||
display:
|
||||
- platform: addressable_light
|
||||
|
@@ -6,7 +6,6 @@ light:
|
||||
rgb_order: GRB
|
||||
num_leds: 256
|
||||
pin: 2
|
||||
rmt_channel: 0
|
||||
|
||||
display:
|
||||
- platform: addressable_light
|
||||
|
@@ -12,7 +12,6 @@ light:
|
||||
rgb_order: GRB
|
||||
num_leds: 256
|
||||
pin: 2
|
||||
rmt_channel: 0
|
||||
effects:
|
||||
- e131:
|
||||
universe: 1
|
||||
|
@@ -12,7 +12,6 @@ light:
|
||||
rgb_order: GRB
|
||||
num_leds: 256
|
||||
pin: 2
|
||||
rmt_channel: 0
|
||||
effects:
|
||||
- e131:
|
||||
universe: 1
|
||||
|
@@ -27,6 +27,7 @@ lvgl:
|
||||
bg_color: light_blue
|
||||
disp_bg_color: color_id
|
||||
disp_bg_image: cat_image
|
||||
disp_bg_opa: cover
|
||||
theme:
|
||||
obj:
|
||||
border_width: 1
|
||||
@@ -132,10 +133,16 @@ lvgl:
|
||||
|
||||
pages:
|
||||
- id: page1
|
||||
bg_image_src: cat_image
|
||||
on_load:
|
||||
- logger.log: page loaded
|
||||
- lvgl.widget.focus:
|
||||
action: restore
|
||||
- if:
|
||||
condition:
|
||||
lvgl.page.is_showing: page1
|
||||
then:
|
||||
logger.log: "Yes, page1 showing"
|
||||
on_unload:
|
||||
- logger.log: page unloaded
|
||||
- lvgl.widget.focus: mark
|
||||
@@ -206,7 +213,7 @@ lvgl:
|
||||
- lvgl.animimg.stop: anim_img
|
||||
- lvgl.update:
|
||||
disp_bg_color: 0xffff00
|
||||
disp_bg_image: cat_image
|
||||
disp_bg_image: none
|
||||
- lvgl.widget.show: message_box
|
||||
- label:
|
||||
text: "Hello shiny day"
|
||||
|
@@ -7,7 +7,6 @@ display:
|
||||
height: 320
|
||||
- platform: sdl
|
||||
id: sdl1
|
||||
auto_clear_enabled: false
|
||||
dimensions:
|
||||
width: 480
|
||||
height: 480
|
||||
@@ -40,4 +39,3 @@ lvgl:
|
||||
text: Click ME
|
||||
on_click:
|
||||
logger.log: Clicked
|
||||
|
||||
|
@@ -6,7 +6,6 @@ light:
|
||||
rgb_order: GRB
|
||||
num_leds: 256
|
||||
pin: 2
|
||||
rmt_channel: 0
|
||||
- platform: partition
|
||||
name: Partition Light
|
||||
segments:
|
||||
|
@@ -6,7 +6,6 @@ light:
|
||||
rgb_order: GRB
|
||||
num_leds: 256
|
||||
pin: 2
|
||||
rmt_channel: 0
|
||||
- platform: partition
|
||||
name: Partition Light
|
||||
segments:
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import pytest
|
||||
import string
|
||||
|
||||
from hypothesis import given, example
|
||||
from hypothesis.strategies import one_of, text, integers, builds
|
||||
from hypothesis import example, given
|
||||
from hypothesis.strategies import builds, integers, ip_addresses, one_of, text
|
||||
import pytest
|
||||
|
||||
from esphome import config_validation
|
||||
from esphome.config_validation import Invalid
|
||||
from esphome.core import CORE, Lambda, HexInt
|
||||
from esphome.core import CORE, HexInt, Lambda
|
||||
|
||||
|
||||
def test_check_not_templatable__invalid():
|
||||
@@ -145,6 +145,28 @@ def test_boolean__invalid(value):
|
||||
config_validation.boolean(value)
|
||||
|
||||
|
||||
@given(value=ip_addresses(v=4).map(str))
|
||||
def test_ipv4__valid(value):
|
||||
config_validation.ipv4address(value)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("value", ("127.0.0", "localhost", ""))
|
||||
def test_ipv4__invalid(value):
|
||||
with pytest.raises(Invalid, match="is not a valid IPv4 address"):
|
||||
config_validation.ipv4address(value)
|
||||
|
||||
|
||||
@given(value=ip_addresses(v=6).map(str))
|
||||
def test_ipv6__valid(value):
|
||||
config_validation.ipaddress(value)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("value", ("127.0.0", "localhost", "", "2001:db8::2::3"))
|
||||
def test_ipv6__invalid(value):
|
||||
with pytest.raises(Invalid, match="is not a valid IP address"):
|
||||
config_validation.ipaddress(value)
|
||||
|
||||
|
||||
# TODO: ensure_list
|
||||
@given(integers())
|
||||
def hex_int__valid(value):
|
||||
|
@@ -1,10 +1,8 @@
|
||||
import pytest
|
||||
|
||||
from hypothesis import given
|
||||
from hypothesis.strategies import ip_addresses
|
||||
import pytest
|
||||
from strategies import mac_addr_strings
|
||||
|
||||
from esphome import core, const
|
||||
from esphome import const, core
|
||||
|
||||
|
||||
class TestHexInt:
|
||||
@@ -26,25 +24,6 @@ class TestHexInt:
|
||||
assert actual == expected
|
||||
|
||||
|
||||
class TestIPAddress:
|
||||
@given(value=ip_addresses(v=4).map(str))
|
||||
def test_init__valid(self, value):
|
||||
core.IPAddress(*value.split("."))
|
||||
|
||||
@pytest.mark.parametrize("value", ("127.0.0", "localhost", ""))
|
||||
def test_init__invalid(self, value):
|
||||
with pytest.raises(ValueError, match="IPAddress must consist of 4 items"):
|
||||
core.IPAddress(*value.split("."))
|
||||
|
||||
@given(value=ip_addresses(v=4).map(str))
|
||||
def test_str(self, value):
|
||||
target = core.IPAddress(*value.split("."))
|
||||
|
||||
actual = str(target)
|
||||
|
||||
assert actual == value
|
||||
|
||||
|
||||
class TestMACAddress:
|
||||
@given(value=mac_addr_strings())
|
||||
def test_init__valid(self, value):
|
||||
|
Reference in New Issue
Block a user