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

switchbot #16396

Merged
merged 7 commits into from Sep 6, 2018

Conversation

Projects
None yet
4 participants
@Danielhiversen
Member

Danielhiversen commented Sep 3, 2018

Description:

Adds support for https://www.switch-bot.com/

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

Example entry for configuration.yaml (if applicable):

- platform: switchbot
  mac: 'ea:c6.....'

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:

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

  • New dependencies have been added to the REQUIREMENTS variable ([example][ex-requir]).
  • New dependencies are only imported inside functions that use them ([example][ex-import]).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

Danielhiversen added some commits Sep 3, 2018

@Danielhiversen Danielhiversen referenced this pull request Sep 3, 2018

Merged

Create switch.switchbot.markdown #6186

1 of 2 tasks complete
self._mac = mac
self._device = None

def _sendpacket(self, key, retry=2) -> bool:

This comment has been minimized.

@MartinHjelmare

MartinHjelmare Sep 3, 2018

Member

This belongs in a standalone library.

This comment has been minimized.

@Danielhiversen

Danielhiversen Sep 3, 2018

Member

Ok, I thought it might be ok since it so few lines.
But I will make a standalone library.

For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.switchbot
"""
import binascii

This comment has been minimized.

@houndci-bot

houndci-bot Sep 5, 2018

'binascii' imported but unused

@MartinHjelmare

Nice! Two small comments.

})


def setup_platform(hass, config, add_devices, discovery_info=None):

This comment has been minimized.

@MartinHjelmare

MartinHjelmare Sep 6, 2018

Member

Rename add_devices to add_entities.

def setup_platform(hass, config, add_devices, discovery_info=None):
"""Perform the setup for Switchbot devices."""
name = config.get(CONF_NAME)
mac_addr = config.get(CONF_MAC)

This comment has been minimized.

@MartinHjelmare

MartinHjelmare Sep 6, 2018

Member

Use dict[key] for required config keys.

Danielhiversen added some commits Sep 6, 2018

@MartinHjelmare

Can be merged when build passes.

@homeassistant homeassistant added cla-signed and removed cla-recheck labels Sep 6, 2018

@Danielhiversen Danielhiversen merged commit 5bd9be6 into dev Sep 6, 2018

6 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.006%) to 93.773%
Details

@wafflebot wafflebot bot removed the in progress label Sep 6, 2018

@Danielhiversen Danielhiversen deleted the switchbot branch Sep 6, 2018

@balloob balloob referenced this pull request Sep 17, 2018

Merged

0.78.0 #16666

@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.