ualex73 / monitor_docker

Monitor Docker containers from Home Assistant
Apache License 2.0
268 stars 34 forks source link

[Feature Request] Disable Switch Creation #11

Closed SlickUnderTheGun closed 4 years ago

SlickUnderTheGun commented 4 years ago

If possible, please add yaml options to not create all and/or individual container switches. Home Assistant says that the created switches do not have a unique ID so they can not be disabled through the UI. Thank you.

ualex73 commented 4 years ago

The id should be unique, the default name is "switch.docker_". A per container option takes more work, but disabling all switches i will add today/tomorrow to the code.

SlickUnderTheGun commented 4 years ago

The entity names are unique but HA also uses an ID it keeps in a file in the .storage folder that isn't able to be modified by users as far as I'm aware. I've never looked into how or why it decides to create this ID.

I personally only need the disable all switches option but thought other people may have a reason to only disable specific containers. Thanks again.

ualex73 commented 4 years ago

Yes, it is on my wishlist to make it configurable per container, only that requires a bit more coding/testing ;-)

ualex73 commented 4 years ago

Just commit the change. Download the *.py files from the repository and add "switch: false" to your config and it should work.

ualex73 commented 4 years ago

I released v1.1 including this feature request.