Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for controlling input_boolean is only partly implemented #146

Closed
skannea opened this issue Oct 3, 2020 · 2 comments
Closed

Support for controlling input_boolean is only partly implemented #146

skannea opened this issue Oct 3, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@skannea
Copy link

skannea commented Oct 3, 2020

Bug report

Description

It is not clearly said in the documentation that you can control an 'input_boolean' as if it were a 'switch'. However, the domains "switch", "input_boolean", "binary_sensor" are all allowed according to the code.

The problem is that SwitchController class methods on, off and toggle are hard coded to the services "switch/turn_on" and so on.
For example:

    @action
    async def on(self) -> None:
        await self.call_service("switch/turn_on", entity_id=self.switch)

This works only for the switch domain.
I made this modification to make them work, but there might be some better way:

    @action
    async def on(self) -> None:
        await self.call_service( self.switch.split('.')[0] + "/turn_on", entity_id=self.switch)

AppDaemon app configuration

conbee_1:
  module: controllerx
  class: E1743SwitchController
  controller: tradfri_on_off_switch
  integration: deconz  
  switch: input_boolean.epsilon
@skannea skannea added the bug Something isn't working label Oct 3, 2020
@xaviml
Copy link
Owner

xaviml commented Oct 3, 2020

Hi @skannea,

Thank you for spotting this.

Regarding that SwitchControkker can be used for input_boolean and binary_sensor (not sure why I support this one since it cannot be modified) is in here.

Regarding the call service, it could be changed to homeassistant.toggle service which is a generic service that toggles all these entities. I will change this for next release.

Cheers,
Xavi M.

@xaviml
Copy link
Owner

xaviml commented Oct 9, 2020

This has been fixed in ControllerX v4.0.0. Now you can use switch controllers for anything that turns on/off and toggle (alert, automation, cover, input_boolean, light, media_player, script, switch).

@xaviml xaviml closed this as completed Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants