mirror of
https://github.com/esphome/esphome.git
synced 2025-03-15 07:08:20 +00:00
last chance++++++++++
This commit is contained in:
parent
57faa7c25b
commit
dc91e85ba4
@ -58,20 +58,20 @@ PLATFORM_SCHEMA = vol.All(sensor.PLATFORM_SCHEMA.extend({
|
|||||||
|
|
||||||
|
|
||||||
def to_code(config):
|
def to_code(config):
|
||||||
for pl_02_5_ in gpio_input_pin_expression(config[CONF_PIN_02_5]):
|
|
||||||
yield
|
|
||||||
for pl_10_0_ in gpio_input_pin_expression(config[CONF_PIN_10_0]):
|
|
||||||
yield
|
|
||||||
|
|
||||||
rhs = App.make_ppd42x(PPD42X_TYPES[config[CONF_TYPE]], config.get(CONF_UPDATE_INTERVAL))
|
rhs = App.make_ppd42x(PPD42X_TYPES[config[CONF_TYPE]], config.get(CONF_UPDATE_INTERVAL))
|
||||||
ppd = Pvariable(config[CONF_ID], rhs)
|
ppd = Pvariable(config[CONF_ID], rhs)
|
||||||
|
|
||||||
if CONF_PM_2_5 in config:
|
if CONF_PM_2_5 in config:
|
||||||
|
for pl_02_5_ in gpio_input_pin_expression(config[CONF_PIN_02_5]):
|
||||||
|
yield
|
||||||
conf = config[CONF_PM_2_5]
|
conf = config[CONF_PM_2_5]
|
||||||
sensor.register_sensor(ppd.make_pl_02_5_sensor(conf[CONF_NAME], pl_02_5_.copy()), conf)
|
sensor.register_sensor(ppd.make_pl_02_5_sensor(conf[CONF_NAME], pl_02_5_.copy()), conf)
|
||||||
|
|
||||||
if CONF_PM_10_0 in config:
|
if CONF_PM_10_0 in config:
|
||||||
conf = config[CONF_PM_10_0]
|
for pl_10_0_ in gpio_input_pin_expression(config[CONF_PIN_10_0]):
|
||||||
|
yield
|
||||||
|
conf = config[CONF_PM_10_0]
|
||||||
sensor.register_sensor(ppd.make_pl_10_0_sensor(conf[CONF_NAME], pl_10_0_.copy()), conf)
|
sensor.register_sensor(ppd.make_pl_10_0_sensor(conf[CONF_NAME], pl_10_0_.copy()), conf)
|
||||||
|
|
||||||
setup_component(ppd, config)
|
setup_component(ppd, config)
|
||||||
|
@ -89,8 +89,8 @@ sensor:
|
|||||||
pm_10_0:
|
pm_10_0:
|
||||||
name: "PM 10.0 Concentration"
|
name: "PM 10.0 Concentration"
|
||||||
- platform: ppd42x
|
- platform: ppd42x
|
||||||
pin_02_5: GPIO27
|
|
||||||
type: PPD42NJ
|
type: PPD42NJ
|
||||||
|
pin_02_5: GPIO27
|
||||||
pm_2_5:
|
pm_2_5:
|
||||||
name: "PM 2.5 Concentration"
|
name: "PM 2.5 Concentration"
|
||||||
- platform: ppd42x
|
- platform: ppd42x
|
||||||
|
Loading…
x
Reference in New Issue
Block a user