taHC81 / Eltek-Flatpack2-ESPhome

Monitor and configure Eltek Flaptak2 PSU using ESPhome
MIT License
12 stars 2 forks source link

Invalid device_classes is an invalid option #1

Closed bashers222 closed 10 months ago

bashers222 commented 10 months ago

ESPHOME is failing validation of this yaml code immediately:



number.template: [source /config/can-test.yaml:154]
  platform: template
  id: eltek_voltage
  name: Eltek FP2 voltage

  [device_class] is an invalid option for [number.template]. Please check the indentation.
  device_class: voltage
  unit_of_measurement: V
  update_interval: 5s
  restore_value: True
  min_value: 43.5
  max_value: 57.6
  step: 0.1
  optimistic: True
number.template: [source /config/can-test.yaml:166]
  platform: template
  id: eltek_current
  name: Eltek FP2 current

  [device_class] is an invalid option for [number.template]. Please check the indentation.
  device_class: current
  unit_of_measurement: A
  update_interval: 5s
  restore_value: True
  min_value: 0.1
  max_value: 41.7
  step: 0.1
  optimistic: True
taHC81 commented 10 months ago

Obviously you've got it incorrectly intended. Should be like the one below.

number:
  - platform: template
    id: eltek_voltage
    name: "Eltek FP2 voltage"
    device_class: voltage
bashers222 commented 10 months ago

sorry, what i meant was I copied the raw code to a brand new vanilla ESPhome YAML (and updated wifi accordingly) But ESPhome thorws an error when it attempts to validate the code as per the repo. What ive added above is the ESPhome output

You're code has the correct indentation, but ESPhome is not happy for some reason and i dont believe its indentation

taHC81 commented 10 months ago

No idea, compiled without any issue here. eltek-compile

bashers222 commented 10 months ago

Im running v2022.11.4 and you're on 2023.10.6. Thats probably my first avenue of investigation :)

bashers222 commented 10 months ago

yep, that sorted it. sorry to trouble you

taHC81 commented 10 months ago

Perfect, enjoy that.