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

Greenwave Reality (TCP Connected) Lighting Component #11282

Merged
merged 9 commits into from Dec 24, 2017

Conversation

Projects
None yet
5 participants
@dfiel
Copy link
Contributor

commented Dec 23, 2017

Created component to add support for End of Life Greenwave Reality (TCP Connected) gateway and lightbulbs

Description:

Related issue (if applicable): Added support for new platform

Example entry for configuration.yaml (if applicable):

light:
  - platform: greenwave
    host: 192.168.1.97
    version: 3

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.

dfiel added some commits Dec 23, 2017

"""Instruct the light to turn on."""
import greenwavereality as greenwave
temp_brightness = int((kwargs.get(ATTR_BRIGHTNESS, 255) / 255) * 100)
greenwave.set_brightness(self._host, self._did, temp_brightness, self.token)

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Dec 23, 2017

line too long (84 > 79 characters)

Update greenwave.py
Line too long

dfiel added some commits Dec 23, 2017

/ 255) * 100)
greenwave.set_brightness(self._host, self._did,
temp_brightness, self.token)
greenwave.turn_on(self._host, self._did, self.token)

This comment has been minimized.

Copy link
@pvizeli

pvizeli Dec 23, 2017

Member

You are sure that is also need to send a brightness and after that also a on?

This comment has been minimized.

Copy link
@dfiel

dfiel Dec 23, 2017

Author Contributor

Yes, both are required.

@pvizeli
Copy link
Member

left a comment

Looks good

add_devices(TcpLights(device, host, token) for device in doc)


class TcpLights(Light):

This comment has been minimized.

Copy link
@pvizeli

pvizeli Dec 23, 2017

Member

GreenwaveLight or like this. Other suggest that the class represent more than one light and run into name conflicts

This comment has been minimized.

Copy link
@dfiel

dfiel Dec 23, 2017

Author Contributor

That was left over from when this was named TCP Lighting, changing it now.

import greenwavereality as greenwave
import os
host = config.get(CONF_HOST)
tokenfile = hass.config.path('greenwave.token')

This comment has been minimized.

Copy link
@pvizeli

pvizeli Dec 23, 2017

Member

use .greenwave so that should be not editable for users with a .

This comment has been minimized.

Copy link
@dfiel

dfiel Dec 23, 2017

Author Contributor

Changing that now

else:
token = None
doc = greenwave.grab_xml(host, token)
add_devices(TcpLights(device, host, token) for device in doc)

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Dec 23, 2017

undefined name 'TcpLights'

dfiel and others added some commits Dec 23, 2017

@pvizeli pvizeli merged commit 8683d75 into home-assistant:dev Dec 24, 2017

4 checks passed

cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 94.06%
Details
hound No violations found. Woof!

ciotlosm added a commit to ciotlosm/home-assistant that referenced this pull request Jan 4, 2018

Greenwave Reality (TCP Connected) Lighting Component (home-assistant#…
…11282)

* Create greenwave.py

* Update .coveragerc

* Update requirements_all.txt

* Update greenwave.py

Line too long

* Update greenwave.py

* Update requirements_all.txt

* Update greenwave.py

* Update greenwave.py

* fix style

@balloob balloob referenced this pull request Jan 11, 2018

Merged

0.61 #11589

@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.
You can’t perform that action at this time.