8000 Add support for Insteon FanLinc fan by jawilson · Pull Request #6959 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for Insteon FanLinc fan #6959

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

Merged
merged 8 commits into from
Jun 19, 2017
Merged

Add support for Insteon FanLinc fan #6959

merged 8 commits into from
Jun 19, 2017

Conversation

jawilson
Copy link
Contributor
@jawilson jawilson commented Apr 6, 2017

Description:

Insteon FanLinc fan support was added in version 0.41 of the insteonlocal depency. This adds support for that in HomeAssistant. I have been using this for some time and it works great. I also bumped the insteonlocal dependency since there's a new one out.

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

Example entry for configuration.yaml (if applicable):

insteon_local:
  host: YOUR HUB IP
  username: YOUR HUB USERNAME
  password: YOUR HUB PASSWORD
  timeout: 10
  port: 25105

fan:
  - platform: insteon_local

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.

@mention-bot
Copy link

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


def turn_on(self: ToggleEntity, speed: str=None, **kwargs) -> None:
"""Turn device on."""
if speed == None:

Choose a reason for hiding this comment

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

comparison to None should be 'if cond is None:'

@jawilson
Copy link
Contributor Author
jawilson commented Apr 6, 2017

Looks like one completely un-related flaky test failed.

Copy link
Member
@balloob balloob left a comment

Choose a reason for hiding this comment

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

Sorry for taking so long to review, looks like all our reviewers are pretty busy.

setup_fan(device_id, data.get('name'), insteonhub, hass,
add_devices_callback)

_CONFIGURING[device_id] = configurator.request_config(
Copy link
Member

Choose a reason for hiding this comment

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

This is a very weird use case of the configurator. We shouldn't have people configure it like this, they can much better rename the devices via customize later.

Let's remove this functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fine with me. Just as a heads up, this was directly copied from Insteon Local Light (this entire implementation is basically just a copy replacing light with fan).

Copy link
Member

Choose a reason for hiding this comment

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

Yeah we should remove it there too, for a future PR. Let's just make sure we don't introduce new instances for now.

Copy link
Member
@balloob balloob left a comment

Choose a reason for hiding this comment

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

This is ok to merge once the configurator stuff has been removed.

conf_fans = config_from_file(hass.config.path(INSTEON_LOCAL_FANS_CONF))
for device_id in conf_fans:
add_devices_callback([InsteonLocalFanDevice(insteonhub.fan(device_id),
name)])

Choose a reason for hiding this comment

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

undefined name 'name'


conf_fans = config_from_file(hass.config.path(INSTEON_LOCAL_FANS_CONF))
for device_id in conf_fans:
add_devices_callback([InsteonLocalFanDevice(insteonhub.fan(device_id),

Choose a reason for hiding this comment

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

undefined name 'add_devices_callback'

ATTR_SPEED, SPEED_OFF, SPEED_LOW, SPEED_MEDIUM, SPEED_HIGH,
SUPPORT_SET_SPEED, FanEntity)
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.loader import get_component

Choose a reason for hiding this comment

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

'homeassistant.loader.get_component' imported but unused

@robbiet480
Copy link
Member

@jawilson I removed the configurator stuff, can you please test this and let us know if it still works and is good to merge?

@jawilson
Copy link
Contributor Author
jawilson commented May 11, 2017

@robbiet480 your changes completely remove all discovery of linked devices on the hub, insteonhub.get_linked() was completely removed.

@balloob the reason for the very weird usage of the configurator is because there is no way to infer device names from insteonlocal. So without the user informing HASS of each device's name, you'll end up with very vague device object_ids. I very much prefer having fan.office_fan and fan.living_room instead of fan.fanlinc_1 and fan.fanlinc_2. Sure I can change the display name, but writing configs will get extremely confusing when you have a handful of lights/fans without any meaningful names. Unless you have any other thoughts, I suggest we revert @robbiet480's changes and use the configurator how it's being using in lights.insteon_local.

@jawilson
Copy link
Contributor Author

Alternatively, we could add an Insteon Local panel that allows you to set the object_ids of insteon_local devices. But I haven't even looked at front-end development yet (nor do I really want to).

@balloob
Copy link
Member
balloob commented May 13, 2017

It should not be a concern of a component to address naming of object ids. There was an issue (can't find it right now) that was addressing object id renaming in a global fashion.

@balloob
Copy link
Member
balloob commented Jun 3, 2017

I'm down with reverting it for now since rest of insteon local needs fixing too. Since it's your branch, can you revert the commit and rebase on latest dev to resolve merge conflicts ?

jawilson added 2 commits June 14, 2017 11:19
This reverts commit 04d1f7f.
This reverts commit 7b8278d.
Conflicts:
	homeassistant/components/insteon_local.py
	requirements_all.txt
@jawilson
Copy link
Contributor Author

@balloob reverted and updated

@balloob balloob merged commit 756768e into home-assistant:dev Jun 19, 2017
@balloob balloob mentioned this pull request Jul 1, 2017
@jawilson jawilson deleted the insteon-fanlinc branch July 6, 2017 03:58
dethpickle pushed a commit to dethpickle/home-assistant that referenced this pull request Aug 18, 2017
* Add support for Insteon FanLinc fan

* Upgrade insteonlocal dependency to 0.49

* Lint/flake fixes

* Remove configurator

* Make Hound fixes

* Revert "Make Hound fixes" and "Remove configurator"

This reverts commit 04d1f7f.
This reverts commit 7b8278d.
@home-assistant home-assistant locked and limited conversation to collaborators Oct 20, 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.

7 participants
0