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

REST binary sensor value_template optional #8596

Conversation

philhawthorne
Copy link
Contributor

Description

According to the documentation, the value_template for the REST
binary_sensor is not required. However, if you don't provide this when
setting up a binary sensor, the component fails. Looks like a variable
was not being set, which I've now included.

This should make the REST binary sensor act the same way as the REST
sensor now.

Example entry for configuration.yaml:

binary_sensor:
  - platform: rest
    resource: http://IP_ADDRESS/ENDPOINT
    method: POST

According to the documentation, the `value_template` for the REST
binary_sensor is not required. However, if you don't provide this when
setting up a binary sensor, the component fails. Looks like a variable
was not being set, which I've now included.

This should make the REST binary sensor act the same way as the REST
sensor now.
@mention-bot
Copy link

@philhawthorne, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fabaff, @armills and @balloob to be potential reviewers.

@pvizeli
Copy link
Member

pvizeli commented Jul 22, 2017

Can you add a unittest to protect this problem for future?

@philhawthorne
Copy link
Contributor Author

Sure. I couldn't see any current unit tests for this type of sensor, so should I just add a new file for it?

@pvizeli
Copy link
Member

pvizeli commented Jul 23, 2017

We should make unittest for this component so we are sure that it work. But you need not do it now

@pvizeli pvizeli merged commit 5d810da into home-assistant:dev Jul 23, 2017
@balloob balloob mentioned this pull request Jul 29, 2017
dethpickle pushed a commit to dethpickle/home-assistant that referenced this pull request Aug 18, 2017
According to the documentation, the `value_template` for the REST
binary_sensor is not required. However, if you don't provide this when
setting up a binary sensor, the component fails. Looks like a variable
was not being set, which I've now included.

This should make the REST binary sensor act the same way as the REST
sensor now.
@home-assistant home-assistant locked and limited conversation to collaborators Dec 11, 2017
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.

5 participants