Skip to content

Tahoma switches#13636

Merged
fabaff merged 3 commits intohome-assistant:devfrom
ikucuze:TahomaSwitches
Apr 5, 2018
Merged

Tahoma switches#13636
fabaff merged 3 commits intohome-assistant:devfrom
ikucuze:TahomaSwitches

Conversation

@ikucuze
Copy link
Copy Markdown
Contributor

@ikucuze ikucuze commented Apr 2, 2018

Added the ability to switch Tahoma Garage door relay.

Description:

Those are special switches that can only be pushed.
Their state is always OFF, they react to the turn_on action, perform it, but stay OFF

Related issue (if applicable): None

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5118

Example entry for configuration.yaml (if applicable):

None (included within tahoma plateform)

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

  • None

If the code communicates with devices, web services, or third-party tools:

  • No New dependencies

ikucuze added 2 commits April 2, 2018 14:19
Those are special switches that can only be pushed.
Their state is always OFF, they react to the turn_on action, perform it, but stay OFF
@bachya
Copy link
Copy Markdown
Contributor

bachya commented Apr 2, 2018

Please don't delete the PR template. Without it, reviewers can't reasonable tell whether they should do anything with this.

@ikucuze
Copy link
Copy Markdown
Contributor Author

ikucuze commented Apr 3, 2018

Sorry, 1st PR... :)
Better this way ?

return 'garage'
return None

def turn_on(self, **kwargs):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need this. switch.toggle works just fine, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try to remove it to check that, but I think I tryed.
I think I couldn't have it displayed on GUI then, or that the GUI does not offer the "toggle" button. I might have miss something ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As expected:
File "/mnt/d/git/home-assistant/homeassistant/helpers/entity.py", line 388, in turn_on
raise NotImplementedError()

The switch exposed on the GUI uses on/off function. It would probably possible to call toggle directly, but in order to have a more user friendly interface, I think it is better to keep the "turn_on" function.

@fabaff fabaff merged commit e6006e9 into home-assistant:dev Apr 5, 2018
@balloob balloob mentioned this pull request Apr 13, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
@ghost ghost removed the platform: switch.tahoma label Mar 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants