1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 03:12:20 +01:00

Merge branch 'dev' into bump-1.18.0b1

This commit is contained in:
Jesse Hills
2021-05-10 07:54:06 +12:00
139 changed files with 7201 additions and 1297 deletions

View File

@@ -9,6 +9,8 @@ esphome:
name_add_mac_suffix: true
platform: ESP32
board: nodemcu-32s
platformio_options:
board_build.partitions: huge_app.csv
on_boot:
priority: 150.0
then:
@@ -69,6 +71,7 @@ wifi:
password: ''
channel: 14
bssid: 'A1:63:95:47:D3:1D'
enable_mdns: true
manual_ip:
static_ip: 192.168.178.230
gateway: 192.168.178.1
@@ -235,10 +238,19 @@ wled:
adalight:
mcp3008:
- id: 'mcp3008_hub'
cs_pin: GPIO12
esp32_ble_tracker:
ble_client:
- mac_address: AA:BB:CC:DD:EE:FF
id: ble_foo
- mac_address: 11:22:33:44:55:66
id: ble_blah
on_connect:
then:
- switch.turn_on: ble1_status
on_disconnect:
then:
- switch.turn_on: ble1_status
mcp23s08:
- id: 'mcp23s08_hub'
cs_pin: GPIO12
@@ -251,6 +263,18 @@ mcp23s17:
sensor:
- platform: ble_client
ble_client_id: ble_foo
name: "Green iTag btn"
service_uuid: 'ffe0'
characteristic_uuid: 'ffe1'
descriptor_uuid: 'ffe2'
notify: true
update_interval: never
on_notify:
then:
- lambda: |-
ESP_LOGD("green_btn", "Button was pressed, val%f", x);
- platform: adc
pin: A0
name: 'Living Room Brightness'
@@ -746,6 +770,13 @@ sensor:
id: 'workshop_PMC_10_0'
address: 0x69
update_interval: 10s
- platform: sht4x
temperature:
name: 'SHT4X Temperature'
humidity:
name: 'SHT4X Humidity'
address: 0x44
update_interval: 15s
- platform: shtcx
temperature:
name: 'Living Room Temperature 10'
@@ -878,12 +909,6 @@ sensor:
id: ph_ezo
address: 99
unit_of_measurement: 'pH'
- platform: mcp3008
update_interval: 5s
mcp3008_id: 'mcp3008_hub'
id: freezer_temp_source
reference_voltage: 3.19
number: 0
esp32_touch:
setup_mode: False
@@ -1489,14 +1514,14 @@ climate:
min_temperature: 18 °C
max_temperature: 25 °C
temperature_step: 0.1 °C
name: "Electrolux EACS"
name: 'Electrolux EACS'
beeper: true
outdoor_temperature:
name: "Temp"
name: 'Temp'
power_usage:
name: "Power"
name: 'Power'
humidity_setpoint:
name: "Hum"
name: 'Hum'
midea_dongle:
uart_id: uart0
@@ -1726,6 +1751,8 @@ switch:
# Use pin number 0
number: 0
inverted: False
- platform: template
id: ble1_status
fan:
- platform: binary
@@ -1761,6 +1788,13 @@ interval:
btn_left_state = ((uint32_t) id(btn_left)->get_value() + 63 * (uint32_t)btn_left_state) >> 6;
id(btn_left)->set_threshold(btn_left_state * 0.9);
- if:
condition:
display.is_displaying_page:
id: display1
page_id: page1
then:
- logger.log: 'Seeing page 1'
color:
- id: kbx_red
@@ -1994,6 +2028,18 @@ cover:
debug:
tca9548a:
- address: 0x70
id: multiplex0
scan: True
- address: 0x71
id: multiplex1
scan: True
multiplexer:
id: multiplex0
channel: 0
pcf8574:
- id: 'pcf8574_hub'
address: 0x21

View File

@@ -14,6 +14,7 @@ ethernet:
clk_mode: GPIO0_IN
phy_addr: 0
power_pin: GPIO25
enable_mdns: false
manual_ip:
static_ip: 192.168.178.56
gateway: 192.168.178.1
@@ -54,6 +55,10 @@ deep_sleep:
as3935_i2c:
irq_pin: GPIO12
mcp3008:
- id: 'mcp3008_hub'
cs_pin: GPIO12
sensor:
- platform: homeassistant
entity_id: sensor.hello_world
@@ -70,6 +75,16 @@ sensor:
- platform: ble_rssi
service_uuid: '11223344-5566-7788-99aa-bbccddeeff00'
name: 'BLE Test Service 128'
- platform: b_parasite
mac_address: F0:CA:F0:CA:01:01
humidity:
name: 'b-parasite Air Humidity'
temperature:
name: 'b-parasite Air Temperature'
moisture:
name: 'b-parasite Soil Moisture'
battery_voltage:
name: 'b-parasite Battery Voltage'
- platform: senseair
id: senseair0
co2:
@@ -202,12 +217,21 @@ sensor:
- platform: inkbird_ibsth1_mini
mac_address: 38:81:D7:0A:9C:11
temperature:
name: 'Inkbird IBS-TH1 Temperature'
name: 'Inkbird IBS-TH1 Temperature'
humidity:
name: 'Inkbird IBS-TH1 Humidity'
name: 'Inkbird IBS-TH1 Humidity'
battery_level:
name: 'Inkbird IBS-TH1 Battery Level'
name: 'Inkbird IBS-TH1 Battery Level'
- platform: sgp40
name: 'Workshop VOC'
update_interval: 5s
store_baseline: 'true'
- platform: mcp3008
update_interval: 5s
mcp3008_id: 'mcp3008_hub'
id: freezer_temp_source
reference_voltage: 3.19
number: 0
time:
- platform: homeassistant
on_time:

View File

@@ -177,6 +177,26 @@ api:
kp: 1.0
kd: 1.0
ki: 1.0
- service: fingerprint_grow_enroll
variables:
finger_id: int
num_scans: int
then:
- fingerprint_grow.enroll:
finger_id: !lambda 'return finger_id;'
num_scans: !lambda 'return num_scans;'
- service: fingerprint_grow_cancel_enroll
then:
- fingerprint_grow.cancel_enroll:
- service: fingerprint_grow_delete
variables:
finger_id: int
then:
- fingerprint_grow.delete:
finger_id: !lambda 'return finger_id;'
- service: fingerprint_grow_delete_all
then:
- fingerprint_grow.delete_all:
wifi:
ssid: 'MySSID'
@@ -423,7 +443,23 @@ sensor:
- platform: ezo
id: ph_ezo
address: 99
unit_of_measurement: 'pH'
unit_of_measurement: 'pH'
- platform: tof10120
name: "Distance sensor"
update_interval: 5s
- platform: fingerprint_grow
fingerprint_count:
name: "Fingerprint Count"
status:
name: "Fingerprint Status"
capacity:
name: "Fingerprint Capacity"
security_level:
name: "Fingerprint Security Level"
last_finger_id:
name: "Fingerprint Last Finger ID"
last_confidence:
name: "Fingerprint Last Confidence"
time:
- platform: homeassistant
@@ -486,6 +522,8 @@ binary_sensor:
- platform: ttp229_bsf
channel: 1
name: TTP229 BSF Test
- platform: fingerprint_grow
name: "Fingerprint Enrolling"
- platform: custom
lambda: |-
auto s = new CustomBinarySensor();
@@ -919,3 +957,33 @@ display:
http_request:
useragent: esphome/device
timeout: 10s
fingerprint_grow:
sensing_pin: 4
password: 0x12FE37DC
new_password: 0xA65B9840
on_finger_scan_matched:
- homeassistant.event:
event: esphome.${devicename}_fingerprint_grow_finger_scan_matched
data:
finger_id: !lambda 'return finger_id;'
confidence: !lambda 'return confidence;'
on_finger_scan_unmatched:
- homeassistant.event:
event: esphome.${devicename}_fingerprint_grow_finger_scan_unmatched
on_enrollment_scan:
- homeassistant.event:
event: esphome.${devicename}_fingerprint_grow_enrollment_scan
data:
finger_id: !lambda 'return finger_id;'
scan_num: !lambda 'return scan_num;'
on_enrollment_done:
- homeassistant.event:
event: esphome.${devicename}_fingerprint_grow_node_enrollment_done
data:
finger_id: !lambda 'return finger_id;'
on_enrollment_failed:
- homeassistant.event:
event: esphome.${devicename}_fingerprint_grow_enrollment_failed
data:
finger_id: !lambda 'return finger_id;'

View File

@@ -160,3 +160,9 @@ display:
lambda: |-
it.rectangle(0, 0, it.get_width(), it.get_height());
external_components:
- source: github://esphome/esphome@dev
refresh: 1d
components: ["bh1750"]
- source: ../esphome/components
components: ["sntp"]

View File

@@ -27,7 +27,7 @@ def test_alphanumeric__invalid(value):
config_validation.alphanumeric(value)
@given(value=text(alphabet=string.ascii_lowercase + string.digits + "_-"))
@given(value=text(alphabet=string.ascii_lowercase + string.digits + "-_"))
def test_valid_name__valid(value):
actual = config_validation.valid_name(value)

View File

@@ -503,13 +503,13 @@ class TestEsphomeCore:
def test_address__wifi(self, target):
target.config = {}
target.config[const.CONF_WIFI] = {const.CONF_USE_ADDRESS: "1.2.3.4"}
target.config["ethernet"] = {const.CONF_USE_ADDRESS: "4.3.2.1"}
target.config[const.CONF_ETHERNET] = {const.CONF_USE_ADDRESS: "4.3.2.1"}
assert target.address == "1.2.3.4"
def test_address__ethernet(self, target):
target.config = {}
target.config["ethernet"] = {const.CONF_USE_ADDRESS: "4.3.2.1"}
target.config[const.CONF_ETHERNET] = {const.CONF_USE_ADDRESS: "4.3.2.1"}
assert target.address == "4.3.2.1"

View File

@@ -9,7 +9,7 @@ from mock import MagicMock
@pytest.fixture
def default_config():
return {
"name": "test_name",
"name": "test-name",
"platform": "test_platform",
"board": "test_board",
"ssid": "test_ssid",
@@ -21,7 +21,7 @@ def default_config():
@pytest.fixture
def wizard_answers():
return [
"test_node", # Name of the node
"test-node", # Name of the node
"ESP8266", # platform
"nodemcuv2", # board
"SSID", # ssid
@@ -305,13 +305,14 @@ def test_wizard_offers_better_node_name(tmpdir, monkeypatch, wizard_answers):
"""
When the node name does not conform, a better alternative is offered
* Removes special chars
* Replaces spaces with underscores
* Replaces spaces with hyphens
* Replaces underscores with hyphens
* Converts all uppercase letters to lowercase
"""
# Given
wizard_answers[0] = "Küche #2"
expected_name = "kuche_2"
wizard_answers[0] = "Küche_Unten #2"
expected_name = "kuche-unten-2"
monkeypatch.setattr(
wz, "default_input", MagicMock(side_effect=lambda _, default: default)
)