Giter Club home page Giter Club logo

integration_blueprint's Introduction

Notice

The component and platforms in this repository are not meant to be used by a user, but as a "blueprint" that custom component developers can build upon, to make more awesome stuff.

HAVE FUN! 😎

Why?

This is simple, by having custom_components look (README + structure) the same it is easier for developers to help each other and for users to start using them.

If you are a developer and you want to add things to this "blueprint" that you think more developers will have use for, please open a PR to add it :)

What?

This repository contains multiple files, here is a overview:

File Purpose  Documentation
.devcontainer.json Used for development/testing with Visual Studio Code. Documentation
.github/ISSUE_TEMPLATE/*.yml Templates for the issue tracker Documentation
.vscode/tasks.json Tasks for the devcontainer. Documentation
custom_components/integration_blueprint/* Integration files, this is where everything happens. Documentation
CONTRIBUTING.md Guidelines on how to contribute. Documentation
LICENSE The license file for the project. Documentation
README.md The file you are reading now, should contain info about the integration, installation and configuration instructions. Documentation
requirements.txt Python packages used for development/lint/testing this integration. Documentation

How?

  1. Create a new repository in GitHub, using this repository as a template by clicking the "Use this template" button in the GitHub UI.
  2. Open your new repository in Visual Studio Code devcontainer (Preferably with the "Dev Containers: Clone Repository in Named Container Volume..." option).
  3. Rename all instances of the integration_blueprint to custom_components/<your_integration_domain> (e.g. custom_components/awesome_integration).
  4. Rename all instances of the Integration Blueprint to <Your Integration Name> (e.g. Awesome Integration).
  5. Run the scripts/develop to start HA and test out your new integration.

Next steps

These are some next steps you may want to look into:

integration_blueprint's People

Contributors

antonverburg avatar ctso avatar dependabot[bot] avatar eifinger avatar eseglem avatar github-actions[bot] avatar iantrich avatar jcgoette avatar linushoppe avatar ludeeus avatar matthewflamm avatar mattrayner avatar mjmeli avatar oncleben31 avatar raman325 avatar rianoc avatar rodpayne avatar rroller avatar salem84 avatar scottg489 avatar sleiner avatar swartjean avatar tefinger avatar tetienne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

integration_blueprint's Issues

A test tried to use socket.socket

Hello, I am having issues getting pytest to work with the blueprint. It gives me an error that A test tried to use socket.socket. I am running pytest tests/test_api.py on an unmodified download of the integration_blueprint and I receive the error output below. It is identical to the error I receive when running tests on the custom component I am building out. I expected the unmodified integration_blueprint to not produce the error.

FAILED tests/test_api.py::test_api - pytest_socket.SocketBlockedError: A test tried to use socket.socket.

Results (0.11s):
       1 error
DEBUG:asyncio:Using proactor: IocpProactor
DEBUG:asyncio:Using proactor: IocpProactor
DEBUG:asyncio:Using proactor: IocpProactor
Exception ignored in: <function BaseEventLoop.__del__ at 0x000001A553E5B490>
Traceback (most recent call last):
  File "~\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 682, in __del__
    self.close()
  File "~\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 686, in close
    self._close_self_pipe()
  File "~\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 754, in _close_self_pipe
    self._ssock.close()
AttributeError: 'ProactorEventLoop' object has no attribute '_ssock'

Add sample service and add show how to check for hardware in config flow

Is your feature request related to a problem? Please describe.
I have an integration that has a service, but now I want to add config flow to it. Your repo is commonly used, so I think it would be a good addition.

Describe the solution you'd like
I'd like to have a sample service that I could use to for example update the sensor value. Ideally, when running the config flow we should be able to check for specific device (in my case I need to check for I2C device)

Livisi suddenly not working

System Health details

Not abailable

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

While installing the Integration, it sends the Message „unknown error“
IMG_1487

Reproduction steps

  1. I tretrieved a backup 2 days old only; no sucess
  2. before, i uninstalled the Integration Livisi unofficial

...

Debug logs

File "/config/custom_components/livisi/config_flow.py", line 47, in async_step_user
    self.aio_livisi = await livisi_connect(
                      ^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/livisi/livisi_connector.py", line 40, in connect
    await connection.connect(host, password)
  File "/config/custom_components/livisi/livisi_connector.py", line 68, in connect
    await self._async_retrieve_token()
  File "/config/custom_components/livisi/livisi_connector.py", line 142, in _async_retrieve_token
    self.token = access_data["access_token"]
                 ~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'access_token'

Diagnostics dump

Not available

Instructions on how to add external requirements and use them in dev environment with autocomplete

Is your feature request related to a problem? Please describe.
I'm trying to create a custom integration that is using external libraries as requirements.
I've added them to manifest.json but when trying to use them in VS Code I get import errors like this:
image

I'm using:
Windows 10
VS Code 1.47.2
Dev Containers as a development environment

Describe the solution you'd like
I'd like to be able to add new requirements to manifest.json, then, even manually, call some script and be able to use those libraries in my dev environment - no errors, proper autocomplete

Describe alternatives you've considered
There are no good alternatives. Right now I'm coding without autocomplete, I push code to git, update my integration via HACS, and test the changes. This takes a lot of time.

Additional context
I've tried installing packages via pip (https://pypi.org/project/RPi.GPIO/) but still, I get those import errors and no autocomplete
Some integrations are adding special comments like shown here:
https://github.com/home-assistant/core/blob/f1d3c0d19b4065a1f6ec80ecdc080380f728196c/homeassistant/components/bme280/sensor.py#L6-L7
but I think this is a workaround, not a solution.

Opening the url in the browser crashes HA due to an openssl issue

System Health details

The system health cannot be provided, because opening the HA url in the browser generates an error.

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

Opening the url reported back by VSCode when running scripts/develop in the dev container will crash HA, with an error message in the browser and on the command line where I started HA (scripts/develop).

Reproduction steps

  1. Clone the repo
  2. Open it in VSCode
  3. Build and open in dev container
  4. Building of the container does not show issues
  5. The postCreateCommand (scripts/setup) also runs fine
  6. Starting HA via scripts/develop seems to be ok
  7. But when opening the HA url in the browser will produce an error (both in the browser and in the command line where the script was started.

In one of the trials I saw an error message that OpenSSL version was incompatible, but I can no longer get it to show.

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. pyopenssl 23.0.0 requires cryptography<40,>=38.0.0, but you have cryptography 35.0.0 which is incompatible.

Debug logs

Logs in the console window:
==========================

2023-03-31 16:42:09 DEBUG (MainThread) [asyncio] <Server sockets=(<asyncio.TransportSocket fd=11, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('0.0.0.0', 8123)>, <asyncio.TransportSocket fd=12, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('::', 8123, 0, 0)>)> got a new connection from ('127.0.0.1', 50248): <socket.socket fd=14, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 8123), raddr=('127.0.0.1', 50248)>
2023-03-31 16:42:09 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/home/vscode/.local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/home/vscode/.local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/home/vscode/.local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/home/vscode/.local/lib/python3.10/site-packages/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/home/vscode/.local/lib/python3.10/site-packages/homeassistant/components/http/forwarded.py", line 80, in forwarded_middleware
    from hass_nabucasa import (  # pylint: disable=import-outside-toplevel
  File "/home/vscode/.local/lib/python3.10/site-packages/hass_nabucasa/__init__.py", line 15, in <module>
    from .auth import CloudError, CognitoAuth
  File "/home/vscode/.local/lib/python3.10/site-packages/hass_nabucasa/auth.py", line 7, in <module>
    import boto3
  File "/home/vscode/.local/lib/python3.10/site-packages/boto3/__init__.py", line 17, in <module>
    from boto3.session import Session
  File "/home/vscode/.local/lib/python3.10/site-packages/boto3/session.py", line 17, in <module>
    import botocore.session
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/session.py", line 26, in <module>
    import botocore.client
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/client.py", line 15, in <module>
    from botocore import waiter, xform_name
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/waiter.py", line 18, in <module>
    from botocore.docs.docstring import WaiterDocstring
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/docs/__init__.py", line 15, in <module>
    from botocore.docs.service import ServiceDocumenter
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/docs/service.py", line 14, in <module>
    from botocore.docs.client import ClientDocumenter, ClientExceptionsDocumenter
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/docs/client.py", line 17, in <module>
    from botocore.docs.example import ResponseExampleDocumenter
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/docs/example.py", line 13, in <module>
    from botocore.docs.shape import ShapeDocumenter
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/docs/shape.py", line 19, in <module>
    from botocore.utils import is_json_value_header
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/utils.py", line 37, in <module>
    import botocore.httpsession
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/httpsession.py", line 46, in <module>
    from urllib3.contrib.pyopenssl import (
  File "/home/vscode/.local/lib/python3.10/site-packages/urllib3/contrib/pyopenssl.py", line 50, in <module>
    import OpenSSL.crypto
  File "/home/vscode/.local/lib/python3.10/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import SSL, crypto
  File "/home/vscode/.local/lib/python3.10/site-packages/OpenSSL/SSL.py", line 19, in <module>
    from OpenSSL.crypto import (
  File "/home/vscode/.local/lib/python3.10/site-packages/OpenSSL/crypto.py", line 3258, in <module>
    utils.deprecated(
TypeError: deprecated() got an unexpected keyword argument 'name'


Browser response page with the error:
====================================
500 Internal Server Error
Traceback:

Traceback (most recent call last):
  File "/home/vscode/.local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/home/vscode/.local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/home/vscode/.local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/home/vscode/.local/lib/python3.10/site-packages/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/home/vscode/.local/lib/python3.10/site-packages/homeassistant/components/http/forwarded.py", line 80, in forwarded_middleware
    from hass_nabucasa import (  # pylint: disable=import-outside-toplevel
  File "/home/vscode/.local/lib/python3.10/site-packages/hass_nabucasa/__init__.py", line 15, in <module>
    from .auth import CloudError, CognitoAuth
  File "/home/vscode/.local/lib/python3.10/site-packages/hass_nabucasa/auth.py", line 7, in <module>
    import boto3
  File "/home/vscode/.local/lib/python3.10/site-packages/boto3/__init__.py", line 17, in <module>
    from boto3.session import Session
  File "/home/vscode/.local/lib/python3.10/site-packages/boto3/session.py", line 17, in <module>
    import botocore.session
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/session.py", line 26, in <module>
    import botocore.client
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/client.py", line 15, in <module>
    from botocore import waiter, xform_name
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/waiter.py", line 18, in <module>
    from botocore.docs.docstring import WaiterDocstring
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/docs/__init__.py", line 15, in <module>
    from botocore.docs.service import ServiceDocumenter
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/docs/service.py", line 14, in <module>
    from botocore.docs.client import ClientDocumenter, ClientExceptionsDocumenter
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/docs/client.py", line 17, in <module>
    from botocore.docs.example import ResponseExampleDocumenter
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/docs/example.py", line 13, in <module>
    from botocore.docs.shape import ShapeDocumenter
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/docs/shape.py", line 19, in <module>
    from botocore.utils import is_json_value_header
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/utils.py", line 37, in <module>
    import botocore.httpsession
  File "/home/vscode/.local/lib/python3.10/site-packages/botocore/httpsession.py", line 46, in <module>
    from urllib3.contrib.pyopenssl import (
  File "/home/vscode/.local/lib/python3.10/site-packages/urllib3/contrib/pyopenssl.py", line 50, in <module>
    import OpenSSL.crypto
  File "/home/vscode/.local/lib/python3.10/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import SSL, crypto
  File "/home/vscode/.local/lib/python3.10/site-packages/OpenSSL/SSL.py", line 19, in <module>
    from OpenSSL.crypto import (
  File "/home/vscode/.local/lib/python3.10/site-packages/OpenSSL/crypto.py", line 3258, in <module>
    utils.deprecated(
TypeError: deprecated() got an unexpected keyword argument 'name'

Diagnostics dump

Again, as I cannot get to the HA UI, I cannot share the diagnostics dump.

Instructions for working on a external python module with the container

Is your feature request related to a problem? Please describe.
Can we add instructions to explain how to use a WIP external python module referenced in manifest.json when using the container remote development?
The developer should be able to work on the custom-components code but on the external modules in the same time too.

Describe the solution you'd like
I'm not sure to really now how to do that. We should speak somewhere:

pip install -e ./sampleclient
hass --skip-pip

Describe alternatives you've considered
N/A

Additional context
None

HACS install wrong / not working

sorry to delete this template but I tried to install via HACS and it seems like install is going wrong. It will just install the component directly in custom_components folder and not in a sub directory. I created the folder but it complaints about blueprint not found when doing config check :/

image

image

added this to my configuration.yaml

# BluePrint

blueprint:

EVEN WORSE!

It will remove the WHOLE custom_component folder when uninstalling!!!! DANGERUS!!!

Add example showing multiple entities for a platform

Is your feature request related to a problem? Please describe.
The current platforms are supported via a list of entities to configure. However, all configuration options are optional, which means configurations like the following are possible (although not necessarily intended to be used):

blueprint:
  sensor:
    -
    -
    -

I have no idea if that actually works in YAML, but probably something like sensor: [{}, {}, {}] would.

The reason for this is so that it's possible to add different types of sensors in the future.

Describe the solution you'd like
Add an example with different entities for one of the platforms to show what it would actually look like:

blueprint:
  sensor:
    - type: type1
    - type: type2
      name: Type 2

In this case, type is now required, so there's no possibility to have empty entries. However, it's still possible to configure multiple of the same type. I'm not sure if there's an actual use case for supporting that:

blueprint:
  sensor:
    - type: type1
    - type: type1
      name: Another type 1

Describe alternatives you've considered
Possibly use a dict instead of a list:

blueprint:
  sensor:
    type1:
    type2:
      name: Type 2

This way, it's only possible to configure each type once. An empty configuration for each type is acceptable here, since the key itself is already unique.

One example that could make sense both ways is configuring a sensor that is of the same type but has different options. Both ways could support that, but the way of doing so is a bit different:

list:

blueprint:
  sensor:
    - type: json_entry
      entry_key: key1
      name: Key1 Value
    - type: json_entry
      entry_key: key2
      name: Key2 Value

dict:

blueprint:
  sensor:
    json_entry:
      - entry_key: key1
        name: Key1 Value
      - entry_key: key2
        name: Key2 value        

With this, it's possible to end up creating the exact same sensor multiple times with either approach, however it's still possible to prevent that in the second example by again using a dict instead of a list:

blueprint:
  sensor:
    json_entry:
      key1:
        name: Key1 Value
      key2:
        name: Key2 value        

In the end, I'm not sure it's really worth trying to prevent that. I'm willing to bet several core components can already be easily duplicated via their own configs, e.g. hue. So the original approach is probably fine.

Additional context
It's still a bit odd to have a list if the component only supports one type of entity from a platform, especially if all the configuration options are optional. In that case, the configuration to use the default values would still be

sensor:
  -

It's not very clear what that is doing. It would be more clear using the dict:

sensor:
  blueprint_sensor:

Adding instruction on how to install with HACS

Is your feature request related to a problem? Please describe.
Not really. Just to make it clearer on the installation options for the not experienced users who could find the custom component repository not thru HACS.

Describe the solution you'd like
Add different installation options in the documentation:

  • Manually
  • Thru HACS (with default repo)
  • Thru HACS with adding the repository manually.

Describe alternatives you've considered
Doing nothing ;-)

Additional context
If you agree on the idea. I can work on a PR.

Template infers License

System Health details

N/A

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

General question on licensing

The LICENSE file generated by this template is MIT and changing this file would violate the the license itself 🧑‍🔬

Is MIT license a requirement for projects generated by this template?

I think some clarification around licensing would be nice.

Awesome template BTW!

Reproduction steps

  1. Use template to generate repo

Debug logs

MIT License

Copyright (c) 2020 Joakim Sørensen @ludeeus

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Diagnostics dump

N/A

Failed push actions using default repo

Version of the custom_component

Using latest master

Configuration

N/A

Describe the bug

When I create a new repository from integration_blueprint using the 'Use this template' button, the new repo is created successfully however the push actions workflow fails.

Initially it failed due to not providing a description and missing topics however after correcting these, it passes the Validation job. It is however now failing at the Run tests and I'm unsure on how to resolve.

See debug log below for full details.

From reading some articles online on this ImportError, this may relate to contextfunction being replaced by pass_context in Jinja2 3.0.0 however I'm not entirely sure how to resolve this as the code that refers to this import is not part of this repo.

Please advise if I'm doing something wrong or if there is additional steps required to get these Actions workflow working correctly.

Cheers

Debug log


Run pytest \
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.12/x64/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/_pytest/config/__init__.py", line 185, in console_main
    code = main()
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/_pytest/config/__init__.py", line [14](https://github.com/KevSex/ha-thruk-livestatus/runs/5744002122?check_suite_focus=true#step:5:14)3, in main
    config = _prepareconfig(args, plugins)
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/_pytest/config/__init__.py", line 318, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/_pytest/helpconfig.py", line 100, in pytest_cmdline_parse
    config: Config = outcome.get_result()
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1003, in pytest_cmdline_parse
    self.parse(args)
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1283, in parse
    self._preparse(args, addopts=addopts)
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1[17](https://github.com/KevSex/ha-thruk-livestatus/runs/5744002122?check_suite_focus=true#step:5:17)2, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pluggy/manager.py", line 299, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 170, in exec_module
    exec(co, module.__dict__)
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pytest_homeassistant_custom_component/plugins.py", line 19, in <module>
    from homeassistant import core as ha, loader, runner, util
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/homeassistant/runner.py", line 10, in <module>
    from homeassistant import bootstrap
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/homeassistant/bootstrap.py", line [18](https://github.com/KevSex/ha-thruk-livestatus/runs/5744002122?check_suite_focus=true#step:5:18), in <module>
    from homeassistant import config as conf_util, config_entries, core, loader
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/homeassistant/config.py", line 56, in <module>
    import homeassistant.helpers.config_validation as cv
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/homeassistant/helpers/config_validation.py", line 76, in <module>
    from homeassistant.helpers import (
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/homeassistant/helpers/script_variables.py", line 9, in <module>
    from . import template
  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/homeassistant/helpers/template.py", line [25](https://github.com/KevSex/ha-thruk-livestatus/runs/5744002122?check_suite_focus=true#step:5:25), in <module>
    from jinja2 import contextfunction, pass_context
ImportError: cannot import name 'contextfunction' from 'jinja2' (/opt/hostedtoolcache/Python/3.8.12/x[64](https://github.com/KevSex/ha-thruk-livestatus/runs/5744002122?check_suite_focus=true#step:5:64)/lib/python3.8/site-packages/jinja2/__init__.py)
Error: Process completed with exit code 1.

Tests no longer work due to version incompatabilities

Version of the custom_component

0.0.0, but this is not a bug of the custom_component itself. This is the commit I tested it on: 8637de6

Configuration

N/A

Describe the bug

When cloning repository, creating a new virtual environment, and running tests, the tests fail. This is due to version incompatibility between homeassistant and pytest-homeassistant-custom-component.

pip install -r requirements_test.txt
pytest tests

Debug log

Get a lot of errors like:


File "/path/to/homeassistant/helpers/device_registry.py", line 620, in async_get
    return cast(DeviceRegistry, hass.data[DATA_REGISTRY])
KeyError: 'device_registry'

Remove unnecessary "enabled" options

Is your feature request related to a problem? Please describe.
The enabled option on the various platform configurations is redundant. An entry can only become enabled by adding it to the list. Likewise, removing an entry from the list (or commenting it out) effectively disables it. Both are already possible without the need for the enabled option.

Describe the solution you'd like
Remove the enabled option from the various platform configurations.

Describe alternatives you've considered

Additional context

L10N example

Is your feature request related to a problem? Please describe.
Showcase how the localization could be done in custom component

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

RFC: Usage state?

Hi 👋,

Looking at the state of this (past commits, open issues/PRs), it's clear that this is not really maintained.

I started this repository way back (f686660) with the goal of having a simple starting point for CC authors to start with.
This repo is falling a lot out of sync with core, and even starting it will now have issues. It's clear that somewhere it fell out of my scope of my thoughts.

For me, it's the tests and linters/rules that made me reluctant to continue updating it.
I made an attempt 1,5 years ago #60 but eventually gave up on it. It went so far that Im currently unsubscribed from this repository.

I have this weekend gone over a lot of old stuff and updated/deprecated them, once of which is https://github.com/ludeeus/container which among other things generates the devcontainer that is refrenced in this repo.

If there are not any strong opinions against it I want to do the folowing to it:

  • Transfer the repository to https://github.com/ludeeus
  • Strip it for all tests/linters
  • Reduce code to absolute minimum
  • Update to current standards
  • Add back a subset of usefull linters used by core (maybe ruff?)
  • Tests will not be added back as test are not really possible to do in a generic way, and the main purpose of this is to be generic.

Tagging @oncleben31, @MatthewFlamm, @raman325, @jcgoette for input, as you have committed to this repo in the past.

Deprecated vscode settings in decontainer.json

System Health details

n/a

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

Seems there has been some changes recently to vscode settings. devcontainer.json needs some tuning

  • deprecated python linting settings in favour of extensions. Most python.linting.*, python.formatting.* settings will have no effect. A fix would be add extensions for black et al in devcontainer.json

  • python.pythonPath has been deprecated in favour of python.defaultInterpreterPath. In my integration it seems python.defaultInterpreterPath needs to go in .vscode/settings.json as well or vscode will not pick the correct interpreter

Cheers

Reproduction steps

  1. build devcontainer and vscode will throw warnings

Debug logs

2023-11-25 22:03:24.075 [info] Experiment 'pythonPromptNewFormatterExt' is active
2023-11-25 22:03:24.075 [info] Experiment 'pythonPromptNewToolsExt' is active
2023-11-25 22:03:24.075 [info] Experiment 'pythonREPLSmartSend' is active
2023-11-25 22:03:24.075 [info] Experiment 'pythonTestAdaptercf' is active
2023-11-25 22:03:24.075 [error] Following setting is deprecated: "python.linting.pylintEnabled"
2023-11-25 22:03:24.075 [error] All settings starting with "python.linting." are deprecated and can be removed from settings.
2023-11-25 22:03:24.075 [error] Linting features have been moved to separate linter extensions.
2023-11-25 22:03:24.075 [error] See here for more information: https://code.visualstudio.com/docs/python/linting

Diagnostics dump

n/a

Python 3.10 will be depreciated

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Homeassistant won't work from version 2023.8 with python 3.10. Can we update the devcontainer.json to an image that contains python 3.11?

Describe the solution you'd like

Update "image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.10-bullseye" in devcontainer.json to an image that contains python 3.11 (unfortunately there is not an mcr.microsoft.com/vscode/devcontainers/python container as far as I see).

Describe alternatives you've considered

Additional context

Add tests

Is your feature request related to a problem? Please describe.

There are no tests.

Describe the solution you'd like

Add a basic set of tests with pytests

Describe alternatives you've considered

N/A

Additional context

N/A

Follow the new standard

Is your feature request related to a problem? Please describe.
Blueprint need change to follow the new standard, https://developers.home-assistant.io/blog/2019/04/12/new-integration-structure.html

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Don't run hass (devcontainer) in workspace folder

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Before I start, thank you again for improving this repo. As a none python developer, your blueprint greatly helped me by extending my Home Assistant with extra functionality!

I also like that you use a standard container for the dev container!

I'm not so happy with the fact that Home Assistant runs inside the workspace folder, making it "dirty" with Home Assistant files that are unrelated to the project (custom_component).
I see you fix this by the .gitignore file, in my opinion, this is masking the problem, not actually fixing it.

Describe the solution you'd like

My solution would be to adjust the develop script to something like this:

#!/usr/bin/env bash

set -e

# Create a clean working directory for Home Assistant
sudo rm -rf /hass
sudo mkdir /hass
sudo chown vscode:vscode /hass

# Copy config and custom_components
cp .devcontainer/configuration.yaml /hass
cp -r custom_components/ /hass

# Start Home Assistant
hass -c /hass --debug

Describe alternatives you've considered

Not really alternatives, but I do see some things are not perfect:

  • The use of sudo/chown, IMO not an issue, /home/vscode/hass could be used instead (user home dir)
  • My configuration.yaml is still in the .devcontainer, I think this is the best place to put this file, as this is solely for the dev container.

(I also still have the devcontainer.json inside the .devcontainer folder, as my VSC doesn't popup a dialog to open in a container if the devcontainer.json inside the root).

Additional context

N/A

Dev Container on Raspbery PI3

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

I've been using this template successfully on my Windows machine.
Now, I'd like to develop an integration, which uses BACpypes3. When doing this on my Windows machine, I can't get responses from my BACnet devices. I think this is related to limitations of network traffic. However, if I install my custom component on an actual HA instance running on my Raspberry PI3B, I see the other devices. I think docker on Linuxworks better than Windows in this particular case.

This makes me think, that I should use the dev container on a Raspberry PI. However, I think the docker image in devcontainer.json doesn't work on Linux. Is this hypothesis correct?

Describe the solution you'd like

If my hypothesis above is correct, how can I get the template running on a Raspberry PI3 docker container?

Describe alternatives you've considered

Tried to help myself. But without success due to limited skills :-)

Additional context

None

Unable to open the dev container in VS Code

Version of the custom_component

Latest from the GitHub.

Configuration

Default configuration from integration blueprint

Describe the bug

Unable to open the dev container in VS Code (version 1.65). Steps to reproduce:

  1. git clone https://github.com/custom-components/integration_blueprint
  2. Open integration_blueprint as folder in VS Code
  3. Reopen project in container as VS Code suggests
  4. The following error occurs:
[2511 ms] Start: Run in container: /bin/sh -c container install
Collecting git+git://github.com/home-assistant/home-assistant.git@dev
  Cloning git://github.com/home-assistant/home-assistant.git (to revision dev) to /tmp/pip-req-build-djrom8q7
ERROR: Command errored out with exit status 128: git clone -q git://github.com/home-assistant/home-assistant.git /tmp/pip-req-build-djrom8q7 Check the logs for full command output.
WARNING: You are using pip version 20.2.4; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
[7885 ms] postCreateCommand failed with exit code 1. Skipping any further user-provided commands.

If the same clone command issued from the terminal the following error occurs:

git clone -q git://github.com/home-assistant/home-assistant.git
fatal: remote error:
  The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

Workaround

Run terminal in the container (Terminal->New Terminal):

  1. nano /usr/share/container/upgrade
  2. replace python3 -m pip install --upgrade git+git://github.com/home-assistant/home-assistant.git@dev with python3 -m pip install --upgrade git+https://github.com/home-assistant/home-assistant.git@dev, save changes
  3. run container install

Deebot

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Exclude markdown from removing trailing whitespace

System Health details

NA

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

Template settings removes trailing whitespace on save, this breaks markdown formatting.

Suggest add exclusion for markdown:

"[markdown]": {
    "files.trimTrailingWhitespace": false
}

Reproduction steps

  1. Use trailing double space for newline in .md file
  2. Save
  3. .md formattign gets broken as traling spaces for newline is removed.

Debug logs

NA

Diagnostics dump

NA

Suggestion: Use subdir for hass data

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Currently hass intallation data clogs up directory when the devcontainer is spun up

Describe the solution you'd like

  1. create a subdir hass or the likes
  2. symlink custom_components, configuration.yaml into this dir.
  3. in scripts/develop -> cd ../hass and do install there
  4. .gitignore could then be hass too making it immune to additional hass artifacts, backups etc

Describe alternatives you've considered

N/A

Additional context

N/A

Remove deprecated CONNECTION_CLASS attribute in flow handler?

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

CONNECTION_CLASS is deprecated since since 2021.6.0

CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL

Kudos for a great template!

Describe the solution you'd like

Remove CONNECTION_CLASS

Describe alternatives you've considered

Keep it for backwards compatibility past 2021.6.0

Additional context

N/A

Lint error: ruff doesn't support pyupgrade anymore

System Health details

N/A

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

Github lint step always fails:

Run python3 -m ruff check .
error: Failed to parse `/home/runner/work/retry/retry/.ruff.toml`: TOML parse error at line 44, column 2
   |
44 | [pyupgrade]
   |  ^^^^^^^^^
unknown field `pyupgrade`, expected one of `allowed-confusables`, `builtins`, `cache-dir`, `dummy-variable-rgx`, `exclude`, `extend`, `extend-exclude`, `extend-include`, `extend-ignore`, `extend-select`, `extend-fixable`, `extend-unfixable`, `external`, `fix`, `fix-only`, `fixable`, `format`, `force-exclude`, `ignore`, `ignore-init-module-imports`, `include`, `line-length`, `tab-size`, `required-version`, `respect-gitignore`, `select`, `show-source`, `show-fixes`, `src`, `namespace-packages`, `target-version`, `task-tags`, `typing-modules`, `unfixable`, `flake8-annotations`, `flake8-bandit`, `flake8-bugbear`, `flake8-builtins`, `flake8-comprehensions`, `flake8-errmsg`, `flake8-quotes`, `flake8-self`, `flake8-tidy-imports`, `flake8-type-checking`, `flake8-gettext`, `flake8-implicit-str-concat`, `flake8-import-conventions`, `flake8-pytest-style`, `flake8-unused-arguments`, `isort`, `mccabe`, `pep8-naming`, `pycodestyle`, `pydocstyle`, `pylint`, `per-file-ignores`, `extend-per-file-ignores`

Error: Process completed with exit code 2.

The root cause is this PR, which removed pyupgrade from ruff.

Reproduction steps

Link to Github job example: here.

Debug logs

N/A

Diagnostics dump

N/A

pytest assertion adding entities for domain

Version of the custom_component

Configuration

I have a largely clean fork of the repo as https://github.com/masaccio/integration_blueprint (I've added some @pytest.mark.asyncio that pytest seemed to need)/

Describe the bug

Run as poetry run pytest (fork contains a pyproject.toml) I see passes for all tests except tests/test_switch.py.

Debug log


Test session starts (platform: darwin, Python 3.10.8, pytest 7.2.0, pytest-sugar 0.9.5)
rootdir: /Users/jon/Downloads/my-integration_blueprint, configfile: pyproject.toml, testpaths: tests
plugins: asyncio-0.20.2, xdist-2.5.0, freezegun-0.4.2, forked-1.4.0, sugar-0.9.5, timeout-2.1.0, requests-mock-1.10.0, respx-0.20.1, socket-0.5.1, anyio-3.6.2, test-groups-1.0.3, cov-3.0.0, aiohttp-1.0.4, homeassistant-custom-component-0.12.29
asyncio: mode=strict
collecting ... 
 tests/test_api.py ✓                                                                                                                                                                   14% █▌        
 tests/test_config_flow.py ✓✓✓                                                                                                                                                         57% █████▊    INFO:homeassistant.loader:Loaded integration_blueprint from custom_components.integration_blueprint
WARNING:homeassistant.loader:We found a custom integration integration_blueprint which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

 tests/test_init.py ✓✓                                                                                                                                                                 86% ████████▋ 

――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― test_switch_services ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

hass = <homeassistant.core.HomeAssistant object at 0x140b4d6f0>

    @pytest.mark.asyncio
    async def test_switch_services(hass):
        """Test switch services."""
        # Create a mock entry so we don't have to go through config flow
        config_entry = MockConfigEntry(domain=DOMAIN, data=MOCK_CONFIG, entry_id="test")
        assert await async_setup_entry(hass, config_entry)
        await hass.async_block_till_done()
    
        # Functions/objects can be patched directly in test code as well and can be used to test
        # additional things, like whether a function was called or what arguments it was called with
        with patch(
            "custom_components.integration_blueprint.IntegrationBlueprintApiClient.async_set_title"
        ) as title_func:
>           await hass.services.async_call(
                SWITCH,
                SERVICE_TURN_OFF,
                service_data={ATTR_ENTITY_ID: f"{SWITCH}.{DEFAULT_NAME}_{SWITCH}"},
                blocking=True,
            )

tests/test_switch.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/core.py:1745: in async_call
    task.result()
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/core.py:1782: in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_component.py:213: in handle_service
    await service.entity_service_call(
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/service.py:678: in entity_service_call
    future.result()  # pop exception if have
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py:943: in async_request_call
    await coro
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/service.py:715: in _handle_entity_call
    await result
custom_components/integration_blueprint/switch.py:25: in async_turn_off
    await self.coordinator.async_request_refresh()
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py:175: in async_request_refresh
    await self._debounced_refresh.async_call()
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/debounce.py:82: in async_call
    await task
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py:201: in async_refresh
    await self._async_refresh(log_failures=True)
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py:316: in _async_refresh
    self.async_update_listeners()
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py:121: in async_update_listeners
    update_callback()
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/update_coordinator.py:381: in _handle_coordinator_update
    self.async_write_ha_state()
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py:545: in async_write_ha_state
    self._async_write_ha_state()
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py:583: in _async_write_ha_state
    state = self._stringify_state(available)
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py:551: in _stringify_state
    if (state := self.state) is None:
../../Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py:982: in state
    if (is_on := self.is_on) is None:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <[AttributeError("'NoneType' object has no attribute 'get'") raised in repr()] IntegrationBlueprintBinarySwitch object at 0x140bf1c90>

    @property
    def is_on(self):
        """Return true if the switch is on."""
>       return self.coordinator.data.get("title", "") == "foo"
E       AttributeError: 'NoneType' object has no attribute 'get'

custom_components/integration_blueprint/switch.py:40: AttributeError
--------------------------------------------------------------------------------------- Captured stderr setup ---------------------------------------------------------------------------------------
DEBUG:asyncio:Using selector: KqueueSelector
---------------------------------------------------------------------------------------- Captured log setup -----------------------------------------------------------------------------------------
DEBUG    asyncio:selector_events.py:54 Using selector: KqueueSelector
--------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------
INFO:custom_components.integration_blueprint:
-------------------------------------------------------------------
Integration blueprint
Version: 0.0.1
This is a custom integration!
If you have any issues with this you need to open an issue here:
https://github.com/custom-components/integration_blueprint/issues
-------------------------------------------------------------------

ERROR:custom_components.integration_blueprint:Something really wrong happened! - A test tried to use socket.socket.
DEBUG:custom_components.integration_blueprint:Finished fetching integration_blueprint data in 0.004 seconds (success: True)
INFO:homeassistant.loader:Loaded integration_blueprint from custom_components.integration_blueprint
WARNING:homeassistant.loader:We found a custom integration integration_blueprint which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
INFO:homeassistant.loader:Loaded switch from homeassistant.components.switch
INFO:homeassistant.loader:Loaded sensor from homeassistant.components.sensor
INFO:homeassistant.loader:Loaded binary_sensor from homeassistant.components.binary_sensor
INFO:homeassistant.setup:Setting up switch
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=switch, service=turn_off>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=switch, service=turn_on>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=switch, service=toggle>
INFO:homeassistant.setup:Setup of domain switch took 0.0 seconds
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=switch>
INFO:homeassistant.setup:Setting up sensor
INFO:homeassistant.setup:Setup of domain sensor took 0.0 seconds
INFO:homeassistant.setup:Setting up binary_sensor
INFO:homeassistant.setup:Setup of domain binary_sensor took 0.0 seconds
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sensor>
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=binary_sensor>
INFO:homeassistant.setup:Setting up integration_blueprint
INFO:homeassistant.setup:Setup of domain integration_blueprint took 0.0 seconds
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=integration_blueprint>
INFO:homeassistant.components.switch:Setting up switch.integration_blueprint
INFO:homeassistant.components.sensor:Setting up sensor.integration_blueprint
INFO:homeassistant.components.binary_sensor:Setting up binary_sensor.integration_blueprint
DEBUG:homeassistant.core:Bus:Handling <Event device_registry_updated[L]: action=create, device_id=543c5a236800f9a6cd0362c2228cce09>
INFO:homeassistant.helpers.entity_registry:Registered new switch.integration_blueprint entity: switch.integration_blueprint_switch
DEBUG:homeassistant.core:Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=switch.integration_blueprint_switch>
INFO:homeassistant.helpers.entity_registry:Registered new sensor.integration_blueprint entity: sensor.integration_blueprint_sensor
DEBUG:homeassistant.core:Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=sensor.integration_blueprint_sensor>
INFO:homeassistant.helpers.entity_registry:Registered new binary_sensor.integration_blueprint entity: binary_sensor.integration_blueprint_binary_sensor
DEBUG:homeassistant.core:Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=binary_sensor.integration_blueprint_binary_sensor>
ERROR:homeassistant.components.switch:Error adding entities for domain switch with platform integration_blueprint
Traceback (most recent call last):
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
    self.async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
    if (state := self.state) is None:
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 982, in state
    if (is_on := self.is_on) is None:
  File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/switch.py", line 40, in is_on
    return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
ERROR:homeassistant.components.sensor:Error adding entities for domain sensor with platform integration_blueprint
Traceback (most recent call last):
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
    self.async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
    if (state := self.state) is None:
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/sensor/__init__.py", line 680, in state
    value = self.native_value
  File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/sensor.py", line 25, in native_value
    return self.coordinator.data.get("body")
AttributeError: 'NoneType' object has no attribute 'get'
ERROR:homeassistant.components.binary_sensor:Error adding entities for domain binary_sensor with platform integration_blueprint
Traceback (most recent call last):
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
    self.async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
    if (state := self.state) is None:
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/binary_sensor/__init__.py", line 211, in state
    if (is_on := self.is_on) is None:
  File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/binary_sensor.py", line 35, in is_on
    return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
ERROR:homeassistant.components.switch:Error while setting up integration_blueprint platform for switch
Traceback (most recent call last):
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
    self.async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
    if (state := self.state) is None:
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 982, in state
    if (is_on := self.is_on) is None:
  File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/switch.py", line 40, in is_on
    return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
ERROR:homeassistant.components.sensor:Error while setting up integration_blueprint platform for sensor
Traceback (most recent call last):
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
    self.async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
    if (state := self.state) is None:
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/sensor/__init__.py", line 680, in state
    value = self.native_value
  File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/sensor.py", line 25, in native_value
    return self.coordinator.data.get("body")
AttributeError: 'NoneType' object has no attribute 'get'
ERROR:homeassistant.components.binary_sensor:Error while setting up integration_blueprint platform for binary_sensor
Traceback (most recent call last):
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
    self.async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
    if (state := self.state) is None:
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/binary_sensor/__init__.py", line 211, in state
    if (is_on := self.is_on) is None:
  File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/binary_sensor.py", line 35, in is_on
    return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
DEBUG:homeassistant.core:Bus:Handling <Event call_service[L]: domain=switch, service=turn_off, service_data=entity_id=switch.integration_blueprint_switch>
ERROR:custom_components.integration_blueprint:Something really wrong happened! - A test tried to use socket.socket.
DEBUG:custom_components.integration_blueprint:Finished fetching integration_blueprint data in 0.000 seconds (success: True)
----------------------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------------------
INFO     custom_components.integration_blueprint:__init__.py:41 
-------------------------------------------------------------------
Integration blueprint
Version: 0.0.1
This is a custom integration!
If you have any issues with this you need to open an issue here:
https://github.com/custom-components/integration_blueprint/issues
-------------------------------------------------------------------

ERROR    custom_components.integration_blueprint:api.py:75 Something really wrong happened! - A test tried to use socket.socket.
DEBUG    custom_components.integration_blueprint:update_coordinator.py:307 Finished fetching integration_blueprint data in 0.004 seconds (success: True)
INFO     homeassistant.loader:loader.py:543 Loaded integration_blueprint from custom_components.integration_blueprint
WARNING  homeassistant.loader:loader.py:489 We found a custom integration integration_blueprint which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
INFO     homeassistant.loader:loader.py:543 Loaded switch from homeassistant.components.switch
INFO     homeassistant.loader:loader.py:543 Loaded sensor from homeassistant.components.sensor
INFO     homeassistant.loader:loader.py:543 Loaded binary_sensor from homeassistant.components.binary_sensor
INFO     homeassistant.setup:setup.py:222 Setting up switch
DEBUG    homeassistant.core:core.py:914 Bus:Handling <Event service_registered[L]: domain=switch, service=turn_off>
DEBUG    homeassistant.core:core.py:914 Bus:Handling <Event service_registered[L]: domain=switch, service=turn_on>
DEBUG    homeassistant.core:core.py:914 Bus:Handling <Event service_registered[L]: domain=switch, service=toggle>
INFO     homeassistant.setup:setup.py:270 Setup of domain switch took 0.0 seconds
DEBUG    homeassistant.core:core.py:914 Bus:Handling <Event component_loaded[L]: component=switch>
INFO     homeassistant.setup:setup.py:222 Setting up sensor
INFO     homeassistant.setup:setup.py:270 Setup of domain sensor took 0.0 seconds
INFO     homeassistant.setup:setup.py:222 Setting up binary_sensor
INFO     homeassistant.setup:setup.py:270 Setup of domain binary_sensor took 0.0 seconds
DEBUG    homeassistant.core:core.py:914 Bus:Handling <Event component_loaded[L]: component=sensor>
DEBUG    homeassistant.core:core.py:914 Bus:Handling <Event component_loaded[L]: component=binary_sensor>
INFO     homeassistant.setup:setup.py:222 Setting up integration_blueprint
INFO     homeassistant.setup:setup.py:270 Setup of domain integration_blueprint took 0.0 seconds
DEBUG    homeassistant.core:core.py:914 Bus:Handling <Event component_loaded[L]: component=integration_blueprint>
INFO     homeassistant.components.switch:entity_platform.py:267 Setting up switch.integration_blueprint
INFO     homeassistant.components.sensor:entity_platform.py:267 Setting up sensor.integration_blueprint
INFO     homeassistant.components.binary_sensor:entity_platform.py:267 Setting up binary_sensor.integration_blueprint
DEBUG    homeassistant.core:core.py:914 Bus:Handling <Event device_registry_updated[L]: action=create, device_id=543c5a236800f9a6cd0362c2228cce09>
INFO     homeassistant.helpers.entity_registry:entity_registry.py:494 Registered new switch.integration_blueprint entity: switch.integration_blueprint_switch
DEBUG    homeassistant.core:core.py:914 Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=switch.integration_blueprint_switch>
INFO     homeassistant.helpers.entity_registry:entity_registry.py:494 Registered new sensor.integration_blueprint entity: sensor.integration_blueprint_sensor
DEBUG    homeassistant.core:core.py:914 Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=sensor.integration_blueprint_sensor>
INFO     homeassistant.helpers.entity_registry:entity_registry.py:494 Registered new binary_sensor.integration_blueprint entity: binary_sensor.integration_blueprint_binary_sensor
DEBUG    homeassistant.core:core.py:914 Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=binary_sensor.integration_blueprint_binary_sensor>
ERROR    homeassistant.components.switch:entity_platform.py:437 Error adding entities for domain switch with platform integration_blueprint
Traceback (most recent call last):
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
    self.async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
    if (state := self.state) is None:
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 982, in state
    if (is_on := self.is_on) is None:
  File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/switch.py", line 40, in is_on
    return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
ERROR    homeassistant.components.sensor:entity_platform.py:437 Error adding entities for domain sensor with platform integration_blueprint
Traceback (most recent call last):
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
    self.async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
    if (state := self.state) is None:
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/sensor/__init__.py", line 680, in state
    value = self.native_value
  File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/sensor.py", line 25, in native_value
    return self.coordinator.data.get("body")
AttributeError: 'NoneType' object has no attribute 'get'
ERROR    homeassistant.components.binary_sensor:entity_platform.py:437 Error adding entities for domain binary_sensor with platform integration_blueprint
Traceback (most recent call last):
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
    self.async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
    if (state := self.state) is None:
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/binary_sensor/__init__.py", line 211, in state
    if (is_on := self.is_on) is None:
  File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/binary_sensor.py", line 35, in is_on
    return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
ERROR    homeassistant.components.switch:entity_platform.py:337 Error while setting up integration_blueprint platform for switch
Traceback (most recent call last):
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
    self.async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
    if (state := self.state) is None:
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 982, in state
    if (is_on := self.is_on) is None:
  File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/switch.py", line 40, in is_on
    return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
ERROR    homeassistant.components.sensor:entity_platform.py:337 Error while setting up integration_blueprint platform for sensor
Traceback (most recent call last):
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
    self.async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
    if (state := self.state) is None:
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/sensor/__init__.py", line 680, in state
    value = self.native_value
  File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/sensor.py", line 25, in native_value
    return self.coordinator.data.get("body")
AttributeError: 'NoneType' object has no attribute 'get'
ERROR    homeassistant.components.binary_sensor:entity_platform.py:337 Error while setting up integration_blueprint platform for binary_sensor
Traceback (most recent call last):
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
    self.async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 551, in _stringify_state
    if (state := self.state) is None:
  File "/Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/components/binary_sensor/__init__.py", line 211, in state
    if (is_on := self.is_on) is None:
  File "/Users/jon/Downloads/my-integration_blueprint/custom_components/integration_blueprint/binary_sensor.py", line 35, in is_on
    return self.coordinator.data.get("title", "") == "foo"
AttributeError: 'NoneType' object has no attribute 'get'
DEBUG    homeassistant.core:core.py:914 Bus:Handling <Event call_service[L]: domain=switch, service=turn_off, service_data=entity_id=switch.integration_blueprint_switch>
ERROR    custom_components.integration_blueprint:api.py:75 Something really wrong happened! - A test tried to use socket.socket.
DEBUG    custom_components.integration_blueprint:update_coordinator.py:307 Finished fetching integration_blueprint data in 0.000 seconds (success: True)

 tests/test_switch.py ⨯                                                                                                                                                               100% ██████████
========================================================================================= warnings summary ==========================================================================================
tests/test_switch.py::test_switch_services
  /Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/pytest_homeassistant_custom_component/plugins.py:226: UserWarning: Lingering timer after test <TimerHandle when=762553.8618564156 async_track_point_in_utc_time.<locals>.run_action(<Job HassJobT...0x140bf3c40>>>) at /Users/jon/Library/Caches/pypoetry/virtualenvs/integration-blueprint-VuzzHxvd-py3.10/lib/python3.10/site-packages/homeassistant/helpers/event.py:1305>
    warnings.warn(f"Lingering timer after test {handle}")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
====================================================================================== short test summary info ======================================================================================
FAILED tests/test_switch.py::test_switch_services - AttributeError: 'NoneType' object has no attribute 'get'

Results (0.36s):
       6 passed
       1 failed

Unable to add multiple sensors from same domain

Version of the custom_component

Configuration

Add your logs here.

Describe the bug

I tried adding multiple sensors in my integration, but only the last one was created. I did see something in the logs about unique id's (stupid enough I didn't save the log, and it was last weekend when I worked on it and fixed this.

I'm creating multiple sensors in a loop:
https://github.com/golles/ha-knmi/blob/main/custom_components/knmi/sensor.py#L12

In entity class I changed this:

    def unique_id(self):
        """Return a unique ID to use for this entity."""
        return self.config_entry.entry_id

to:

    def unique_id(self):
        """Return a unique ID to use for this entity."""
        return f"{self.config_entry.entry_id}-{self.name}"

and this seems to work, no complaints about the unique id and I get all the sensors that I expected. I do have to admit I don't have much python experience so I'm not sure if this is THE solution or maybe I did break something else, but still wanted to share my discovery to help make this project better.

Debug log


Add your logs here.

Cannot install the integration

I can't install the Integration. I have tried manually adding the files to the custom components director like the read me describes. I have also tried adding the custom repository via HACS. In both cases when I go to add the Integration I see a Jellyfish Lighting integration but immediately get an error pop up:

Error
Config flow could not be loaded: {"message":"Invalid handler specified"}

OK button.

Suggestion: Provide ssh pubkey to devcontainer

Checklist

edit: found https://code.visualstudio.com/remote/advancedcontainers/sharing-git-credentials, maybe it's just my credentials helper thats buggering me

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

I can't push code to my project from devcontainer

Describe the solution you'd like

Push to my repository from devcontainer

Mount in ssh pub key in devcontainer might be an option? Maybe commented out until explicitly enabled

Describe alternatives you've considered

pushing from another terminal

Additional context

N/A

Test requirements unmet due to outdated version of pip

Version of the custom_component

0.0.1

Describe the bug

  1. Open repo in the devcontainer
  2. Set up venv, install test requirements with pip. It will complain about the dependencies:
(venv) container# pip check
pytest-homeassistant-custom-component 0.4.0 has requirement sqlalchemy==1.4.13, but you have sqlalchemy 1.4.31.
homeassistant 2021.6.0b0 has requirement attrs==21.2.0, but you have attrs 21.4.0.
homeassistant 2021.6.0b0 has requirement httpx==0.18.0, but you have httpx 0.22.0.
homeassistant 2021.6.0b0 has requirement requests==2.25.1, but you have requests 2.27.1.
  1. pytest tests\ command works fine with default tests from integration_blueprint, but causes the error with an inherited repo containing a custom component:
aiohttp 3.8.1 requires async-timeout<5.0,>=4.0.0a3

Solution

  1. Upgrade pip to the latest version (pip-22.0.3)
  2. Run pip3 install -r requirements_test.txt again

Move devcontainer from alpine to debian

Is your feature request related to a problem? Please describe.

Alpine containers do not work in GitHub codespaces.

Describe the solution you'd like

Move the devcontainer to use a debian base instead of alpine.

Describe alternatives you've considered

N/A

Additional context

N/A

Design question about import path ?

What is the rational about using from custom_components.blueprint.const import ... compared to what seems to be the standard of using relative path : from .const import ...

From a template user point of view, it's force us to update all the domain in import instructions. It could be easier to use relative import path.

But perhaps there is a good reason (I don't see yet) to stay with absolute path.

Remove 'sampleclient' and use aiohttp in a `api.py` file instead.

Is your feature request related to a problem? Please describe.
It can be confusing that sampleclient is what "communicates" with the service/device.

Describe the solution you'd like

Use aiohttp with HA's custom client session instead.

Describe alternatives you've considered

httpx, but aiohttp have more track record in HA.

Additional context

N/A

Add tag on the template to be able to reference a specific version.

Is your feature request related to a problem? Please describe.
In cookiecutter-home-assistant-custom-component I try to keep synchronized with the blueprint template. I plan to release once a month. It could be easier for users to know what version of the blueprint the cookiecutter will generate.

Describe the solution you'd like
The blueprint maintainers could add a tag or a release after major modifications.

Describe alternatives you've considered
open for other suggestions

Additional context
N/A

Missing .github/settings.yml

README mentions .github/settings.yml, but it does not exist in repo.

Should remove from README or add .github/settings.yml to repo.

Typo of resorces.json

Filename typo. I don't know what the purpose and usage of this file, so I won't be able to submit PR to fix it.

I/O in event loop

Version of the custom_component

Current master branch.

Configuration

Add your logs here.

Describe the bug

As per @balloob:

it's doing I/O inside the event loop. This should be done inside the executor worker thread.

zachowj/hass-node-red#14

Debug log


Add your logs here.

Missing automations.yaml file

Version of the custom_component

0.0.1

Configuration

default_config:

automation: !include automations.yaml

logger:
  default: error
  logs:
    custom_components.blueprint: debug

Describe the bug

A reference to automations.yaml was added in 411ea16

https://github.com/custom-components/blueprint/blob/411ea16668d1b0257ff842befcd1ec0dfd8027c6/.devcontainer/configuration.yaml#L3 but it looks like an automations.yaml file was not staged. Consequently, there is an error when starting the container.

Debug log


> Executing task: container check <

INFO:homeassistant.util.package:Attempting install of colorlog==4.1.0
Testing configuration at /config
Failed config
  General Errors: 
    - Error loading /config/configuration.yaml:   in "/config/configuration.yaml", line 3, column 13: Unable to read file /config/automations.yaml.

Dont understand how to use the dev container

I'm not sure to understand how to work with the dev container linked to the blueprint.

Version of the custom_component

Latest of the 25th April 2020

Configuration

N/A

Describe the bug

After creating a new github repo using blueprint as a template. I clone it locally on my Mac. I open the folder in dev container and I open a terminal. I tried the command dc init and got this.

container# dc init
/usr/bin/dc: line 6: /usr/share/container/*: No such file or directory
/usr/bin/dc: line 52: InitDevEnv: command not found
the 'dc' CLI is deprecated and will be removed in a future version, use 'cc' instead

So I have tried the cc init command with no more success:

container# cc init
cc: error: init: No such file or directory
cc: fatal error: no input files
compilation terminated.

I'm not sure if it's a bug or a wrong usage of the dev container.

Debug log

N/A

template for managing unresponsive data source on the web

Is your feature request related to a problem? Please describe.
Most of the component are searching data on Internet. Suggesting in the blueprint a best practice to manage when the data source is unresponsive to avoid WARNINGS or ERROR could help the newcomer in plugin development.

Describe the solution you'd like
Open to best practices.

Additional context
N/A

Updating config options multiple times throws errors

If you attempt to update the configuration options more than once, a bunch of errors are thrown in the logs. It also seems to run the __init__.py async_setup_entry multiple times. In the template, the integration recovers fine and keeps running despite the errors in the logs, however the fact that async_setup_entry is running multiple times has caused some issues in my integration that I have to work around. Ideally this wouldn't happen to save that effort.

Steps to Reproduce

  1. Setup the integration (I'm using the raw integration_blueprint template here as this issue exists in the template)
  2. Click "Configure" on the integrations page
  3. Change any setting and click "Submit" - all seems fine
  4. Click "Configure" again
  5. Change any setting again and click "Submit" again - errors will be thrown in the logs

Logs
Below I've annotated with asterisks where I performed the multiple options update. The first time, I disabled the binary_sensor platform. The second time, I re-enabled it.

2021-12-22 03:29:10 DEBUG (MainThread) [custom_components.integration_blueprint] Finished fetching integration_blueprint data in 0.045 seconds (success: True)
***** Configured options first time *****
2021-12-22 03:29:37 DEBUG (MainThread) [custom_components.integration_blueprint] Finished fetching integration_blueprint data in 0.055 seconds (success: True)
2021-12-22 03:29:37 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.integration_blueprint
2021-12-22 03:29:37 INFO (MainThread) [homeassistant.components.switch] Setting up switch.integration_blueprint
2021-12-22 03:30:07 DEBUG (MainThread) [custom_components.integration_blueprint] Finished fetching integration_blueprint data in 0.048 seconds (success: True)
***** Configured options second time *****
2021-12-22 03:30:29 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry test for sensor
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/homeassistant/config_entries.py", line 472, in async_unload
    result = await component.async_unload_entry(hass, self)  # type: ignore
  File "/usr/local/lib/python3.9/site-packages/homeassistant/components/sensor/__init__.py", line 210, in async_unload_entry
    return await component.async_unload_entry(entry)
  File "/usr/local/lib/python3.9/site-packages/homeassistant/helpers/entity_component.py", line 177, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2021-12-22 03:30:29 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry test for switch
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/homeassistant/config_entries.py", line 472, in async_unload
    result = await component.async_unload_entry(hass, self)  # type: ignore
  File "/usr/local/lib/python3.9/site-packages/homeassistant/components/switch/__init__.py", line 95, in async_unload_entry
    return await component.async_unload_entry(entry)
  File "/usr/local/lib/python3.9/site-packages/homeassistant/helpers/entity_component.py", line 177, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2021-12-22 03:30:29 DEBUG (MainThread) [custom_components.integration_blueprint] Finished fetching integration_blueprint data in 0.047 seconds (success: True)
2021-12-22 03:30:29 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.integration_blueprint
2021-12-22 03:30:29 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.integration_blueprint
2021-12-22 03:30:29 INFO (MainThread) [homeassistant.components.switch] Setting up switch.integration_blueprint
2021-12-22 03:30:29 DEBUG (MainThread) [custom_components.integration_blueprint] Finished fetching integration_blueprint data in 0.063 seconds (success: True)
2021-12-22 03:30:29 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry test for binary_sensor
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/homeassistant/config_entries.py", line 333, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/usr/local/lib/python3.9/site-packages/homeassistant/components/binary_sensor/__init__.py", line 163, in async_setup_entry
    return await component.async_setup_entry(entry)
  File "/usr/local/lib/python3.9/site-packages/homeassistant/helpers/entity_component.py", line 162, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!
2021-12-22 03:30:29 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry test for sensor
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/homeassistant/config_entries.py", line 333, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/usr/local/lib/python3.9/site-packages/homeassistant/components/sensor/__init__.py", line 204, in async_setup_entry
    return await component.async_setup_entry(entry)
  File "/usr/local/lib/python3.9/site-packages/homeassistant/helpers/entity_component.py", line 162, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!
2021-12-22 03:30:29 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry test for switch
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/homeassistant/config_entries.py", line 333, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/usr/local/lib/python3.9/site-packages/homeassistant/components/switch/__init__.py", line 89, in async_setup_entry
    return await component.async_setup_entry(entry)
  File "/usr/local/lib/python3.9/site-packages/homeassistant/helpers/entity_component.py", line 162, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!
2021-12-22 03:30:59 DEBUG (MainThread) [custom_components.integration_blueprint] Finished fetching integration_blueprint data in 0.046 seconds (success: True)
2021-12-22 03:31:29 DEBUG (MainThread) [custom_components.integration_blueprint] Finished fetching integration_blueprint data in 0.044 seconds (success: True)

integration cannot have the same name as package

System Health details

System Information

version core-2023.8.3
installation_type Unsupported Third Party Container
dev false
hassio false
docker true
user vscode
virtualenv false
python_version 3.11.4
os_name Linux
os_version 5.10.76-linuxkit
arch x86_64
timezone UTC
config_dir /workspaces/ocpp/config
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Dashboards
dashboards 1
resources 0
mode auto-gen
Recorder
oldest_recorder_run August 20, 2023 at 12:22 PM
current_recorder_run August 21, 2023 at 12:14 AM
estimated_db_size 0.31 MiB
database_engine sqlite
database_version 3.34.1

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

i'm trying to modify an integration called ocpp to be in line with integration_blueprint.
This integration has the same name as a python package it depends upon.

I have installed this package using pip, and verified that it is indeed installed.

When starting hass using the develop script provided in this template, I cannot add the integration because elements in the ocpp package cannot be found.

2023-08-20 21:51:17.452 ERROR (MainThread) [homeassistant.setup] 
Setup failed for custom integration ocpp: 
Unable to import component: No module named 'ocpp.v16'

When the integration is installed through hacs, everything works fine.

When I rename the custom_components/ocpp to custom_components/ocpp_integration everything works fine.

I suspect the issue may be related to the modification of PYTHONPATH.

Reproduction steps

  1. clone ocpp integration from https://github.com/lbbrhzn/ocpp
  2. run pip install < requirements_test.txt
  3. add and run setup and develop scripts
  4. add the OCPP integration in home assistant

Debug logs

2023-08-20 21:51:12.694 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration ocpp which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-08-20 21:51:12.832 INFO (MainThread) [homeassistant.setup] Setup of domain logger took 0.0 seconds
2023-08-20 21:51:12.836 INFO (MainThread) [homeassistant.bootstrap] Setting up frontend: {'frontend'}
2023-08-20 21:51:12.864 INFO (MainThread) [homeassistant.setup] Setting up device_automation
2023-08-20 21:51:12.865 INFO (MainThread) [homeassistant.setup] Setup of domain device_automation took 0.0 seconds
2023-08-20 21:51:13.023 INFO (MainThread) [homeassistant.setup] Setting up lovelace
2023-08-20 21:51:13.026 WARNING (MainThread) [asyncio] Executing <Task pending name='setup component lovelace' coro=<_async_setup_component() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py:288> wait_for=<Task pending name='Storage load lovelace_dashboards' coro=<Store._async_load() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/helpers/storage.py:133> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> took 0.158 seconds
2023-08-20 21:51:13.043 INFO (MainThread) [homeassistant.setup] Setting up http
2023-08-20 21:51:13.060 INFO (MainThread) [homeassistant.setup] Setup of domain lovelace took 0.0 seconds
2023-08-20 21:51:13.092 INFO (MainThread) [homeassistant.setup] Setup of domain http took 0.0 seconds
2023-08-20 21:51:13.130 INFO (MainThread) [homeassistant.setup] Setting up api
2023-08-20 21:51:13.137 INFO (MainThread) [homeassistant.setup] Setup of domain api took 0.0 seconds
2023-08-20 21:51:13.137 INFO (MainThread) [homeassistant.setup] Setting up auth
2023-08-20 21:51:13.140 INFO (MainThread) [homeassistant.setup] Setup of domain auth took 0.0 seconds
2023-08-20 21:51:13.176 INFO (MainThread) [homeassistant.setup] Setting up config
2023-08-20 21:51:13.219 INFO (MainThread) [homeassistant.setup] Setting up diagnostics
2023-08-20 21:51:13.263 INFO (MainThread) [homeassistant.setup] Setting up repairs
2023-08-20 21:51:13.269 INFO (MainThread) [homeassistant.setup] Setup of domain repairs took 0.0 seconds
2023-08-20 21:51:13.436 WARNING (MainThread) [asyncio] Executing <Task finished name='Task-93' coro=<async_setup.<locals>.setup_panel() done, defined at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/components/config/__init__.py:45> result=None created at /usr/local/lib/python3.11/asyncio/tasks.py:374> took 0.150 seconds
2023-08-20 21:51:13.476 INFO (MainThread) [homeassistant.setup] Setting up file_upload
2023-08-20 21:51:13.477 INFO (MainThread) [homeassistant.setup] Setup of domain file_upload took 0.0 seconds
2023-08-20 21:51:13.477 INFO (MainThread) [homeassistant.setup] Setup of domain config took 0.3 seconds
2023-08-20 21:51:13.478 INFO (MainThread) [homeassistant.setup] Setup of domain diagnostics took 0.3 seconds
2023-08-20 21:51:13.595 INFO (MainThread) [homeassistant.setup] Setting up image_upload
2023-08-20 21:51:13.597 WARNING (MainThread) [asyncio] Executing <Task pending name='setup component image_upload' coro=<_async_setup_component() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py:288> wait_for=<Task pending name='Storage load image' coro=<Store._async_load() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/helpers/storage.py:133> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> took 0.102 seconds
2023-08-20 21:51:13.604 INFO (MainThread) [homeassistant.setup] Setting up websocket_api
2023-08-20 21:51:13.605 INFO (MainThread) [homeassistant.setup] Setup of domain websocket_api took 0.0 seconds
2023-08-20 21:51:13.612 INFO (MainThread) [homeassistant.setup] Setup of domain image_upload took 0.0 seconds
2023-08-20 21:51:13.620 INFO (SyncWorker_1) [homeassistant.loader] Loaded group from homeassistant.components.group
2023-08-20 21:51:13.640 INFO (SyncWorker_2) [homeassistant.loader] Loaded device_tracker from homeassistant.components.device_tracker
2023-08-20 21:51:13.744 INFO (MainThread) [homeassistant.setup] Setting up search
2023-08-20 21:51:13.745 INFO (MainThread) [homeassistant.setup] Setup of domain search took 0.0 seconds
2023-08-20 21:51:13.746 WARNING (MainThread) [asyncio] Executing <Task pending name='setup component search' coro=<_async_setup_component() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py:321> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> took 0.108 seconds
2023-08-20 21:51:14.519 INFO (MainThread) [homeassistant.setup] Setting up analytics
2023-08-20 21:51:14.525 WARNING (MainThread) [asyncio] Executing <Task pending name='setup component analytics' coro=<_async_setup_component() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py:288> wait_for=<Task pending name='Storage load core.analytics' coro=<Store._async_load() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/helpers/storage.py:133> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> took 0.779 seconds
2023-08-20 21:51:14.540 INFO (MainThread) [homeassistant.setup] Setting up person
2023-08-20 21:51:14.546 INFO (MainThread) [homeassistant.setup] Setup of domain analytics took 0.0 seconds
2023-08-20 21:51:14.570 INFO (MainThread) [homeassistant.setup] Setup of domain person took 0.0 seconds
2023-08-20 21:51:14.581 INFO (SyncWorker_1) [homeassistant.loader] Loaded hassio from homeassistant.components.hassio
2023-08-20 21:51:14.585 INFO (MainThread) [homeassistant.setup] Setting up onboarding
2023-08-20 21:51:14.600 INFO (MainThread) [homeassistant.setup] Setup of domain onboarding took 0.0 seconds
2023-08-20 21:51:14.622 INFO (MainThread) [homeassistant.setup] Setting up frontend
2023-08-20 21:51:14.638 INFO (MainThread) [homeassistant.setup] Setup of domain frontend took 0.0 seconds
2023-08-20 21:51:14.646 INFO (MainThread) [homeassistant.bootstrap] Setting up recorder: {'recorder'}
2023-08-20 21:51:14.651 INFO (MainThread) [homeassistant.setup] Setting up recorder
2023-08-20 21:51:14.670 INFO (MainThread) [asyncio] <Server sockets=(<asyncio.TransportSocket fd=8, family=10, type=1, proto=6, laddr=('::', 8123, 0, 0)>, <asyncio.TransportSocket fd=10, family=2, type=1, proto=6, laddr=('0.0.0.0', 8123)>)> is serving
2023-08-20 21:51:14.670 INFO (MainThread) [homeassistant.components.http] Now listening on port 8123
2023-08-20 21:51:14.791 INFO (MainThread) [homeassistant.setup] Setup of domain recorder took 0.1 seconds
2023-08-20 21:51:14.792 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 1: {'cloud', 'ssdp', 'usb', 'bluetooth', 'zeroconf', 'api', 'network', 'websocket_api', 'http', 'logger', 'webhook', 'dhcp'}
2023-08-20 21:51:14.831 INFO (MainThread) [homeassistant.setup] Setting up webhook
2023-08-20 21:51:14.833 INFO (MainThread) [homeassistant.setup] Setup of domain webhook took 0.0 seconds
2023-08-20 21:51:14.882 INFO (MainThread) [homeassistant.setup] Setting up usb
2023-08-20 21:51:14.883 INFO (MainThread) [homeassistant.setup] Setup of domain usb took 0.0 seconds
2023-08-20 21:51:14.956 INFO (MainThread) [homeassistant.setup] Setting up dhcp
2023-08-20 21:51:14.957 INFO (MainThread) [homeassistant.setup] Setup of domain dhcp took 0.0 seconds
2023-08-20 21:51:14.958 INFO (MainThread) [homeassistant.setup] Setting up network
2023-08-20 21:51:14.959 INFO (MainThread) [homeassistant.setup] Setup of domain network took 0.0 seconds
2023-08-20 21:51:14.976 INFO (SyncWorker_1) [homeassistant.loader] Loaded google_assistant from homeassistant.components.google_assistant
2023-08-20 21:51:14.977 INFO (SyncWorker_1) [homeassistant.loader] Loaded alexa from homeassistant.components.alexa
2023-08-20 21:51:14.989 INFO (SyncWorker_1) [homeassistant.loader] Loaded camera from homeassistant.components.camera
2023-08-20 21:51:15.096 INFO (MainThread) [homeassistant.setup] Setting up bluetooth
2023-08-20 21:51:15.108 WARNING (MainThread) [asyncio] Executing <Task pending name='setup component bluetooth' coro=<_async_setup_component() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py:288> wait_for=<Task pending name='Storage load bluetooth.remote_scanners' coro=<Store._async_load() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/helpers/storage.py:133> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> took 0.119 seconds
2023-08-20 21:51:15.227 INFO (MainThread) [homeassistant.setup] Setting up zeroconf
2023-08-20 21:51:15.242 INFO (MainThread) [homeassistant.setup] Setup of domain zeroconf took 0.0 seconds
2023-08-20 21:51:15.258 INFO (SyncWorker_0) [homeassistant.loader] Loaded media_player from homeassistant.components.media_player
2023-08-20 21:51:15.299 INFO (MainThread) [homeassistant.components.zeroconf] Starting Zeroconf broadcast
2023-08-20 21:51:15.307 INFO (MainThread) [homeassistant.setup] Setup of domain bluetooth took 0.2 seconds
2023-08-20 21:51:16.200 INFO (MainThread) [homeassistant.setup] Setting up cloud
2023-08-20 21:51:16.204 WARNING (MainThread) [asyncio] Executing <Task pending name='setup component cloud' coro=<_async_setup_component() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py:288> wait_for=<Task pending name='Storage load cloud' coro=<Store._async_load() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/helpers/storage.py:133> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> took 0.883 seconds
2023-08-20 21:51:16.283 INFO (MainThread) [homeassistant.setup] Setting up ssdp
2023-08-20 21:51:16.311 INFO (MainThread) [homeassistant.setup] Setup of domain cloud took 0.1 seconds
2023-08-20 21:51:16.316 INFO (MainThread) [homeassistant.setup] Setup of domain ssdp took 0.0 seconds
2023-08-20 21:51:16.324 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 2: {'config', 'counter', 'analytics', 'schedule', 'default_config', 'timer', 'input_datetime', 'automation', 'script', 'input_button', 'history', 'diagnostics', 'repairs', 'application_credentials', 'trace', 'lovelace', 'search', 'mobile_app', 'sun', 'media_source', 'assist_pipeline', 'input_number', 'input_boolean', 'input_text', 'scene', 'stt', 'conversation', 'map', 'tag', 'homeassistant_alerts', 'logbook', 'onboarding', 'device_automation', 'input_select', 'file_upload', 'energy', 'image_upload', 'zone', 'radio_browser', 'tts', 'ocpp', 'stream', 'person', 'blueprint', 'hardware', 'my', 'system_health', 'auth'}
2023-08-20 21:51:16.345 INFO (MainThread) [homeassistant.setup] Setting up counter
2023-08-20 21:51:16.351 INFO (MainThread) [homeassistant.setup] Setting up schedule
2023-08-20 21:51:16.362 INFO (MainThread) [homeassistant.setup] Setting up timer
2023-08-20 21:51:16.367 INFO (MainThread) [homeassistant.setup] Setting up input_datetime
2023-08-20 21:51:16.373 INFO (MainThread) [homeassistant.setup] Setting up input_button
2023-08-20 21:51:16.485 INFO (MainThread) [homeassistant.setup] Setting up history
2023-08-20 21:51:16.486 INFO (MainThread) [homeassistant.setup] Setup of domain history took 0.0 seconds
2023-08-20 21:51:16.489 WARNING (MainThread) [asyncio] Executing <Task pending name='setup component history' coro=<_async_setup_component() running at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py:321> cb=[set.remove(), Task.task_wakeup()] created at /home/vscode/.local/lib/python3.11/site-packages/homeassistant/core.py:558> took 0.113 seconds
2023-08-20 21:51:16.493 INFO (MainThread) [homeassistant.setup] Setting up trace
2023-08-20 21:51:16.494 INFO (MainThread) [homeassistant.setup] Setup of domain trace took 0.0 seconds
2023-08-20 21:51:16.497 INFO (MainThread) [homeassistant.setup] Setting up sun
2023-08-20 21:51:16.502 INFO (MainThread) [homeassistant.setup] Setup of domain sun took 0.0 seconds
2023-08-20 21:51:16.607 INFO (MainThread) [homeassistant.setup] Setting up input_number
2023-08-20 21:51:16.613 INFO (MainThread) [homeassistant.setup] Setting up input_boolean
2023-08-20 21:51:16.623 INFO (MainThread) [homeassistant.setup] Setting up input_text
2023-08-20 21:51:16.641 INFO (MainThread) [homeassistant.setup] Setting up scene
2023-08-20 21:51:16.666 INFO (MainThread) [homeassistant.setup] Setting up stt
2023-08-20 21:51:16.668 INFO (MainThread) [homeassistant.setup] Setup of domain stt took 0.0 seconds
2023-08-20 21:51:16.669 INFO (MainThread) [homeassistant.setup] Setting up conversation
2023-08-20 21:51:16.675 INFO (MainThread) [homeassistant.setup] Setup of domain conversation took 0.0 seconds
2023-08-20 21:51:16.736 INFO (MainThread) [homeassistant.setup] Setting up tag
2023-08-20 21:51:16.778 INFO (MainThread) [homeassistant.setup] Setting up homeassistant_alerts
2023-08-20 21:51:16.781 INFO (MainThread) [homeassistant.setup] Setup of domain homeassistant_alerts took 0.0 seconds
2023-08-20 21:51:16.784 INFO (MainThread) [homeassistant.setup] Setting up input_select
2023-08-20 21:51:16.789 INFO (MainThread) [homeassistant.setup] Setting up zone
2023-08-20 21:51:16.792 INFO (MainThread) [homeassistant.setup] Setting up tts
2023-08-20 21:51:16.796 INFO (MainThread) [homeassistant.setup] Setting up blueprint
2023-08-20 21:51:16.800 INFO (MainThread) [homeassistant.setup] Setup of domain blueprint took 0.0 seconds
2023-08-20 21:51:16.842 INFO (MainThread) [homeassistant.setup] Setting up hardware
2023-08-20 21:51:16.965 INFO (MainThread) [homeassistant.setup] Setting up radio_browser
2023-08-20 21:51:16.966 INFO (MainThread) [homeassistant.setup] Setup of domain radio_browser took 0.0 seconds
2023-08-20 21:51:17.026 INFO (MainThread) [homeassistant.setup] Setting up application_credentials
2023-08-20 21:51:17.031 INFO (MainThread) [homeassistant.setup] Setting up media_source
2023-08-20 21:51:17.050 INFO (MainThread) [homeassistant.setup] Setup of domain hardware took 0.2 seconds
2023-08-20 21:51:17.103 INFO (MainThread) [homeassistant.setup] Setting up map
2023-08-20 21:51:17.112 INFO (MainThread) [homeassistant.setup] Setup of domain map took 0.0 seconds
2023-08-20 21:51:17.141 INFO (MainThread) [homeassistant.setup] Setting up logbook
2023-08-20 21:51:17.153 INFO (MainThread) [homeassistant.setup] Setting up energy
2023-08-20 21:51:17.155 INFO (MainThread) [homeassistant.setup] Setup of domain energy took 0.0 seconds
2023-08-20 21:51:17.201 INFO (MainThread) [homeassistant.setup] Setting up my
2023-08-20 21:51:17.202 INFO (MainThread) [homeassistant.setup] Setup of domain my took 0.0 seconds
2023-08-20 21:51:17.203 INFO (MainThread) [homeassistant.setup] Setting up system_health
2023-08-20 21:51:17.217 INFO (MainThread) [homeassistant.setup] Setup of domain counter took 0.9 seconds
2023-08-20 21:51:17.220 INFO (MainThread) [homeassistant.setup] Setup of domain timer took 0.9 seconds
2023-08-20 21:51:17.246 INFO (MainThread) [homeassistant.setup] Setup of domain tag took 0.5 seconds
2023-08-20 21:51:17.269 INFO (MainThread) [homeassistant.setup] Setting up automation
2023-08-20 21:51:17.274 INFO (MainThread) [homeassistant.setup] Setting up script
2023-08-20 21:51:17.314 INFO (SyncWorker_0) [homeassistant.loader] Loaded sensor from homeassistant.components.sensor
2023-08-20 21:51:17.331 INFO (MainThread) [homeassistant.setup] Setup of domain media_source took 0.3 seconds
2023-08-20 21:51:17.340 INFO (MainThread) [homeassistant.setup] Setup of domain logbook took 0.2 seconds
2023-08-20 21:51:17.346 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.6 seconds
2023-08-20 21:51:17.350 INFO (MainThread) [homeassistant.setup] Setup of domain system_health took 0.1 seconds
2023-08-20 21:51:17.363 INFO (MainThread) [homeassistant.setup] Setup of domain schedule took 1.0 seconds
2023-08-20 21:51:17.371 INFO (MainThread) [homeassistant.setup] Setup of domain input_button took 1.0 seconds
2023-08-20 21:51:17.377 INFO (MainThread) [homeassistant.setup] Setup of domain input_datetime took 1.0 seconds
2023-08-20 21:51:17.384 INFO (MainThread) [homeassistant.setup] Setup of domain application_credentials took 0.4 seconds
2023-08-20 21:51:17.400 INFO (MainThread) [homeassistant.setup] Setup of domain zone took 0.6 seconds
2023-08-20 21:51:17.452 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration ocpp: Unable to import component: No module named 'ocpp.v16'
Traceback (most recent call last):
  File "/home/vscode/.local/lib/python3.11/site-packages/homeassistant/setup.py", line 215, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/homeassistant/loader.py", line 813, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/workspaces/ocpp/custom_components/ocpp/__init__.py", line 12, in <module>
    from ocpp.v16.enums import AuthorizationStatus
  File "/workspaces/ocpp/custom_components/ocpp/__init__.py", line 12, in <module>
    from ocpp.v16.enums import AuthorizationStatus
ModuleNotFoundError: No module named 'ocpp.v16'

Diagnostics dump

not available.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.