ginkage / MHI-AC-Ctrl-ESPHome

ESPHome integration for MHI-AC-Ctrl project
MIT License
95 stars 35 forks source link

Dashes are not supported in IDs, please use underscores instead. #84

Open Lieta2 opened 4 months ago

Lieta2 commented 4 months ago
git log -1 --oneline
5dc9cbe (HEAD -> master, origin/master, origin/HEAD) Merge pull request #78 from hmmbob/restart-button

With deviceid: "mhi_ac_ctr_bedroom" in lr_mhi_ac_ctrl.yaml

$ esphome compile lr_mhi_ac_ctrl.yaml
INFO ESPHome 2024.2.2
INFO Reading configuration lr_mhi_ac_ctrl.yaml...
WARNING 'mhi_ac_ctr_bedroom': Using the '_' (underscore) character in the hostname is discouraged as it can cause problems with some DHCP and local name services. For more information, see https://esphome.io/guides/faq.html#why-shouldn-t-i-use-underscores-in-my-device-name

but it compiles.

With deviceid: "mhi-ac-ctr-bedroom" lr_mhi_ac_ctrl.yaml

$ esphome compile lr_mhi_ac_ctrl.yaml
INFO ESPHome 2024.2.2
INFO Reading configuration lr_mhi_ac_ctrl.yaml...
Failed config

climate.custom: [source lr_mhi_ac_ctrl.yaml:48]
  platform: custom
  lambda: |-
    auto mhi_ac_ctrl = new MhiAcCtrl();
    App.register_component(mhi_ac_ctrl);
    return {mhi_ac_ctrl};
  climates: 
    - name: none

      Dashes are not supported in IDs, please use underscores instead.
      id: mhi-ac-ctr-bedroom

doesn't compile.

arpiecodes commented 3 months ago

You cannot use dashes (-) in your device ID's. So change those deviceid: "mhi-ac-ctr-bedroom" to device: "mhi_ac_ctr_bedroom" and you should be good to go.