esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

Lambda in Template Sensor is not optional #11

Closed r-jordan closed 5 years ago

r-jordan commented 5 years ago

Operating environment (Hass.io/Docker/pip/etc.): Hass.io/esphomeyaml Addon

ESP (ESP32/ESP8266/Board/Sonoff): Generic

Affected component: https://esphomelib.com/esphomeyaml/components/sensor/template.html

Description of problem: I would like to create a template sensor without lambda because I want to update its value from another sensor with the id(name).publish_state() method but lambda seems to be required although documentation says that it's optional.

Problem-relevant YAML-configuration entries:

sensor:
  - platform: template
    unit_of_measurement: 'W'
    accuracy_decimals: 1
    id: my_power_low

Traceback (if applicable):

Failed config

sensor.template: [source switch_pow_2.yaml:74]

  'lambda' is a required option for [sensor.template].
  platform: template
  unit_of_measurement: W
  accuracy_decimals: 1
  id: my_power_low

Additional information:

OttoWinter commented 5 years ago

Fixed in dev