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

Added support for cover in tellstick #10858

Merged
merged 4 commits into from
Dec 10, 2017

Conversation

perfalk
Copy link
Contributor

@perfalk perfalk commented Nov 29, 2017

Description:

New cover component for tellstick and fix for the main tellstick component to select the cover if it's not a switch or a light.

Related issue (if applicable): fixes #

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

Example entry for configuration.yaml (if applicable):

cover:
  platform: tellstick

Checklist:

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

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

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@homeassistant
Copy link
Contributor

Hi @perfalk,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@Danielhiversen
Copy link
Member

Danielhiversen commented Nov 29, 2017

Thanks for your contribution.

You removed the pr template, but you should fill it out.
I have added it again.

From the checklist you are missing to add tellstick.py to .coveragerc and to update the documentation


def _parse_tellcore_data(self, tellcore_data):
"""Turn the value received from tellcore into something useful."""
return None
Copy link
Member

Choose a reason for hiding this comment

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

Use pass instead

Support for Tellstick switches.

For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.tellstick/
Copy link
Member

Choose a reason for hiding this comment

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

switch -> cover


def _parse_ha_data(self, kwargs):
"""Turn the value from HA into something useful."""
return None
Copy link
Member

Choose a reason for hiding this comment

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

Use pass instead

@perfalk
Copy link
Contributor Author

perfalk commented Nov 29, 2017

tellstick.py already exisit in .coveragerc
no new dependencies are added.
not sure what test should be written for this.

@Danielhiversen
Copy link
Member

You are right. So I do not know why coveralls is red

@arsaboo
Copy link
Contributor

arsaboo commented Nov 29, 2017

Coveralls can be ignored for now. See Paulus's comment here

DATA_TELLSTICK, TellstickDevice)


# pylint: disable=unused-argument
Copy link
Member

Choose a reason for hiding this comment

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

Remove this. It's globally disabled.


# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the Tellstick lights."""
Copy link
Member

Choose a reason for hiding this comment

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

Cover.



class TellstickCover(TellstickDevice, CoverDevice):
"""Representation of a Tellstick switch."""
Copy link
Member

Choose a reason for hiding this comment

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

Cover.


def _update_model(self, new_state, data):
"""Update the device entity state to match the arguments."""
self._state = new_state
Copy link
Member

Choose a reason for hiding this comment

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

Why do this? You haven't implemented the is_closed property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no feedback from Tellstick so I'ts not possible to know if the cover is up, half way or down. I just made it possible to add it as a cover to get the up, down, and stop button.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, so then you don't need this line, right? If you're required to implement this method just pass here.

@pvizeli
Copy link
Member

pvizeli commented Dec 6, 2017

Can you test this?

@perfalk
Copy link
Contributor Author

perfalk commented Dec 10, 2017

@pvizeli Tested and works as expected

@pvizeli pvizeli merged commit 3b228c7 into home-assistant:dev Dec 10, 2017
akatrevorjay added a commit to akatrevorjay/home-assistant that referenced this pull request Dec 11, 2017
…ent-being-nonexistent

* origin/dev:
  Volvo on call: Optional use of Scandinavian miles. Also add average fuel consumption property (home-assistant#11051)
  add custom bypass status to total connect (home-assistant#11042)
  Refactor hue to split bridge support from light platform (home-assistant#10691)
  Add GPS coords to meraki (home-assistant#10998)
  Add a caldav calendar component (home-assistant#10842)
  Added support for cover in tellstick (home-assistant#10858)
akatrevorjay added a commit to akatrevorjay/home-assistant that referenced this pull request Dec 11, 2017
…into dev

* 'dev' of https://github.com/home-assistant/home-assistant:
  Volvo on call: Optional use of Scandinavian miles. Also add average fuel consumption property (home-assistant#11051)
  add custom bypass status to total connect (home-assistant#11042)
  Refactor hue to split bridge support from light platform (home-assistant#10691)
  Add GPS coords to meraki (home-assistant#10998)
  Add a caldav calendar component (home-assistant#10842)
  Added support for cover in tellstick (home-assistant#10858)
@fabaff fabaff mentioned this pull request Dec 16, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Mar 30, 2018
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.

7 participants