esphome-docs icon indicating copy to clipboard operation
esphome-docs copied to clipboard

"name" not required

Open scaarup opened this issue 2 years ago • 5 comments

Does not seem like "name" is required and it is not mentioned in example 2.

Description:

The documentation for a home assistant text sensor, mentions that "name" is a required configuration parameter. On the same page, there is an example given without "name". Also when I test a configuration without "name", it still works fine. So I remove "required" from "name" on this doc.

Related issue (if applicable): fixes

Pull request in esphome with YAML changes (if applicable): esphome/esphome#<esphome PR number goes here>

Checklist:

  • [ ] Branch: next is for changes and new documentation that will go public with the next ESPHome release. Fixes, changes and adjustments for the current release should be created against current.
  • [ ] Link added in /index.rst when creating new documents for new components or cookbook.

scaarup avatar Sep 13 '22 09:09 scaarup

Deploy Preview for esphome ready!

Name Link
Latest commit 79960466f326053aad39e99557bd622965d872a8
Latest deploy log https://app.netlify.com/sites/esphome/deploys/6367c20dc2c0040008c9afe6
Deploy Preview https://deploy-preview-2291--esphome.netlify.app/components/text_sensor/homeassistant
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Sep 13 '22 12:09 netlify[bot]

You should mark it optional, like attribute is.

Now that we are here, shouldn't this page indicate that someone should give this sensor an id so it can be used in other automations / conditions?

name is only useful if you want to forward this thing to say web server or mqtt I guess... never tried though.

and of course the same applies to other Home Asisstant ** things so this PR should keep consistency in case a change is applied

glmnet avatar Sep 13 '22 17:09 glmnet

You should mark it optional, like attribute is.

Now that we are here, shouldn't this page indicate that someone should give this sensor an id so it can be used in other automations / conditions?

name is only useful if you want to forward this thing to say web server or mqtt I guess... never tried though.

and of course the same applies to other Home Asisstant ** things so this PR should keep consistency in case a change is applied

Sorry forgot about that. Name is now marked as optional.

scaarup avatar Sep 14 '22 07:09 scaarup

From what i learned the name is being used for identify the component in Home Assistant. @scaarup, Are you saying that without setting the name property you still use the component?

nielsnl68 avatar Sep 14 '22 13:09 nielsnl68

From what i learned the name is being used for identify the component in Home Assistant. @scaarup, Are you saying that without setting the name property you still use the component?

Yeah it works fine without a "name". And I am only using the text_sensor's internally on the esp, so referring to them by id.

scaarup avatar Sep 15 '22 05:09 scaarup