Skip to content

Resolves #17196, Resolves #18739 - Hue Beyond light fixture errors#19874

Merged
balloob merged 3 commits intohome-assistant:devfrom
alistairg:hue
Jan 9, 2019
Merged

Resolves #17196, Resolves #18739 - Hue Beyond light fixture errors#19874
balloob merged 3 commits intohome-assistant:devfrom
alistairg:hue

Conversation

@alistairg
Copy link
Copy Markdown
Contributor

@alistairg alistairg commented Jan 8, 2019

Description:

Hue Beyond light fixtures report themselves as special groups, that were not correctly recognized by the platform. This lead to various "no entity id" errors amongst others.

This pull adds recognition for the "Luminaire" and "LightGroup" group types, which resolves this error.

**Related issue (if applicable): Fixes #17196, Fixes #18739

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

Example entry for configuration.yaml (if applicable):

Checklist:

  • [ X] The code change is tested and works locally.
  • [X ] Local tests pass with tox. Your PR cannot be merged unless tests pass
  • [ X] There is no commented out code in this PR.

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).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated 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:

  • Tests have been added to verify that the new code works.

@ghost ghost added the in progress label Jan 8, 2019
def device_info(self):
"""Return the device info."""
if self.light.type in ('LightGroup', 'Room'):
if self.light.type in ('LightGroup', 'Room', 'Luminaire', 'LightSource'):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

line too long (81 > 79 characters)

elif item_id not in progress_waiting:
current[item_id].async_schedule_update_ha_state()
if current[item_id].entity_id is None:
_LOGGER.error("ERROR: Current Item %s has no entity ID in API type '%s'. Skipping update.", current[item_id].name, api_type)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

line too long (140 > 79 characters)

if light_id not in progress_waiting:
light.async_schedule_update_ha_state()
if light.entity_id is None:
_LOGGER.error("ERROR: Light %s has no entity ID. Skipping update.", light.name)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

line too long (99 > 79 characters)

def device_info(self):
"""Return the device info."""
if self.light.type in ('LightGroup', 'Room'):
if self.light.type in ('LightGroup', 'Room',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

trailing whitespace

for light_id, light in current.items():
if light_id not in progress_waiting:
light.async_schedule_update_ha_state()
light.async_schedule_update_ha_state()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

trailing whitespace

@balloob balloob added this to the 0.85.0 milestone Jan 9, 2019
@balloob
Copy link
Copy Markdown
Member

balloob commented Jan 9, 2019

Nice catch.

@balloob balloob merged commit 35cb045 into home-assistant:dev Jan 9, 2019
@ghost ghost removed the in progress label Jan 9, 2019
balloob pushed a commit that referenced this pull request Jan 9, 2019
…19874)

* Resolves #17196, Resolves #18739 - Hue Beyond light fixtures being incorrectly recognized

* Removed long code lines that were failing code review

* Removed trailing whitespace
@balloob balloob mentioned this pull request Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Philips Hue Beyond Lamp creates errors 'No entity id specified' for Hue groups

4 participants