Home Assistant Community

Bug or Doc update?: State card does not appear within main panel on hello world example

#1

Hi,

I followed the hello world example in the Development 101, and contrary to what it said, the state card does not appear within main panel.

I setup my dev environment following the Set up Development Environment doc just last week.

Is the doc out of date, or is this a bug?

Em

#2

Have you edited your Lovelace UI? If so, entities are no longer automatically added.

#3

I am no DEV, but I do know that recent updates have caused custom components to need a file called init.py in the folder (this can be a blank file, just needs to be present).

I also saw something about some needing a manifest.json, but I am not sure if this is a requirement, or just needed for some data to work.

Again, I haven’t done any development myself, but to me it looks like the documents need to be updated.

#4

Aha ! Thanks @bosborne. So it is a doc update that is needed. Can you kindly point me out to the part of the doc that explains how to update Lovelace for the hello world example? I will update it and submit a pull request.

#5

Here is a page describing the changes:

snipit:

Each integration is either a single Python file, or a folder with an  `__init__.py` . file. We have updated the documentation and introduced a new section for [integrations](https://developers.home-assistant.io/docs/en/creating_integration_file_structure.html).

Home Assistant 0.92 introduces a new [ `manifest.json` ](https://developers.home-assistant.io/docs/en/creating_integration_manifest.html) for integrations. This file, which is optional for custom components, is used by integrations to specify metadata: name, link to the documentation, dependencies, requirements and code owners.
#6

Thanks @DeadEnd. Will see what I can do.

#7

I just realized I started looking at dev for Hassio addons, not HA custom components.

#8

I don’t get it @DeadEnd: the link does not mention anything about the hello world example or setting up a state card for the Lovelace UI… Can you clarify, please?

#9

Ah… @bosborne. ok. Waiting for someone else to add info. Or else, I will open am issue on GitHub.

1 Like
#10

Okay, this is my basic stab at how it works now.
In you custom components folder, you’ll need to create a subfolder called hello_world (or whatever you want to call it.

inside the hello_world folder, create based on what the component is… I am not sure what the hello-world is considered (sensor, notify, etc.) but if it is a sensor you would create sensor.py and put the code there.

You also need the init.py file in the hello_world folder… and possibly the manifest.json…
Take all this with a grain of salt… I am basing this off what I see in the custom components I am using and what I have seen in release notes.

Anyway, I expect the document is outdated and needs a bit of work to be up with all the changes that have been made that effect custom components.

#11

Yep @DeadEnd, this is pretty much how it works. Following the steps in the doc link I provided does work but for the state card. Hence my question.

All I am looking for now is whether there is a bug (and the state card should have been automatically created), or whether there are steps that once must take to have this state card created (and the doc showing how to do it).

#12

You may want to ask on Discord. The devs tend to hang out there.

#13

Just did that.

1 Like