mirror of
https://github.com/esphome/esphome.git
synced 2025-03-15 15:18:16 +00:00
tests.yaml
This commit is contained in:
parent
89e59cef6c
commit
7e57f99b35
@ -3,7 +3,7 @@ import voluptuous as vol
|
||||
from esphome import pins
|
||||
from esphome.components import sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_PM_2_5, CONF_ID, CONF_PM_10_0, CONF_PM_2_5, CONF_NAME, CONF_PM_10_0, \
|
||||
from esphome.const import CONF_ID, CONF_PM_10_0, CONF_PM_2_5, CONF_NAME, \
|
||||
CONF_UPDATE_INTERVAL, CONF_TIMEOUT
|
||||
from esphome.cpp_generator import Pvariable, add
|
||||
from esphome.cpp_helpers import gpio_input_pin_expression, gpio_output_pin_expression, \
|
||||
@ -12,15 +12,15 @@ from esphome.cpp_types import App
|
||||
|
||||
|
||||
Ppd42xSensorComponent = sensor.sensor_ns.class_('Ppd42xSensorComponent',
|
||||
sensor.PollingSensorComponent)
|
||||
sensor.PollingSensorComponent)
|
||||
|
||||
|
||||
PLATFORM_SCHEMA = cv.nameable(sensor.SENSOR_PLATFORM_SCHEMA.extend({
|
||||
cv.GenerateID(): cv.declare_variable_id(Ppd42xSensorComponent),
|
||||
vol.Optional(CONF_PM_10_0): vol.All(pins.internal_gpio_input_pin_schema,
|
||||
pins.validate_has_interrupt),
|
||||
pins.validate_has_interrupt),
|
||||
vol.Optional(CONF_PM_2_5): vol.All(pins.internal_gpio_input_pin_schema,
|
||||
pins.validate_has_interrupt),
|
||||
pins.validate_has_interrupt),
|
||||
vol.Required(CONF_TIMEOUT): cv.positive_time_period_microseconds,
|
||||
vol.Optional(CONF_UPDATE_INTERVAL): cv.update_interval,
|
||||
|
||||
@ -33,7 +33,7 @@ def to_code(config):
|
||||
for pm_02_5 in gpio_input_pin_expression(config[CONF_PM_2_5]):
|
||||
yield
|
||||
rhs = App.make_ppd42x_sensor(config[CONF_NAME], pm_10_0, pm_02_5,
|
||||
config.get(CONF_UPDATE_INTERVAL))
|
||||
config.get(CONF_UPDATE_INTERVAL))
|
||||
ppd42x = Pvariable(config[CONF_ID], rhs)
|
||||
|
||||
if CONF_TIMEOUT in config:
|
||||
|
@ -5,8 +5,8 @@ esphome:
|
||||
# Use this for testing while developing:
|
||||
# Note the travis check for esphome PRs will fail until the
|
||||
# esphome-core PR has been merged.
|
||||
# esphome_core_version:
|
||||
# local: ~/path/to/esphome-core
|
||||
esphome_core_version:
|
||||
local: /home/pi4homez/github2/esphome-core
|
||||
use_custom_code: false
|
||||
on_boot:
|
||||
priority: 150.0
|
||||
@ -502,6 +502,15 @@ sensor:
|
||||
update_interval: 5min
|
||||
rx_only: false
|
||||
|
||||
- platform: ppd42x
|
||||
timeout: 30000 # mandatory
|
||||
pm_2_5:
|
||||
name: "SDS011 PM2.5"
|
||||
pm_10_0:
|
||||
name: "SDS011 PM10.0"
|
||||
update_interval: 5min
|
||||
|
||||
|
||||
|
||||
esp32_touch:
|
||||
setup_mode: False
|
||||
|
@ -5,8 +5,8 @@ esphome:
|
||||
# Use this for testing while developing:
|
||||
# Note the travis check for esphome PRs will fail until the
|
||||
# esphome-core PR has been merged.
|
||||
# esphome_core_version:
|
||||
# local: ~/path/to/esphome-core
|
||||
esphome_core_version:
|
||||
local: /home/pi4homez/github2/esphome-core
|
||||
build_path: build/test2
|
||||
|
||||
substitutions:
|
||||
|
@ -5,8 +5,8 @@ esphome:
|
||||
# Use this for testing while developing:
|
||||
# Note the travis check for esphome PRs will fail until the
|
||||
# esphome-core PR has been merged.
|
||||
# esphome_core_version:
|
||||
# local: ~/path/to/esphome-core
|
||||
esphome_core_version:
|
||||
local: /home/pi4homez/github2/esphome-core
|
||||
build_path: build/test3
|
||||
|
||||
substitutions:
|
||||
|
Loading…
x
Reference in New Issue
Block a user