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

Fix conflict between illuminance and illuminance_lux #3275

Merged
merged 2 commits into from
Apr 3, 2020

Conversation

kiall
Copy link
Contributor

@kiall kiall commented Apr 3, 2020

On certain devices, e.g. GZCGQ01LM, 9290012607, 9290019758, TERNCY-PP01 etc, both
cfg.sensor_illuminance and cfg.sensor_illuminance_lux are applied. As both of these
had the same object_id, only one would show in Home Assistant. Oddly, a mix of both
would apply - e.g. I would get the illuminance value, with the illuminance_lux unit
of 'lx'.

The new test, without the change to add _lux, would produce the following output:

 FAIL  test/homeassistant.test.js (7.952s)
  ● HomeAssistant extension › Should not have duplicate type/object_ids in a mapping

    expect(received).toHaveLength(expected)

    Expected length: 0
    Received length: 4
    Received array:  ["GZCGQ01LM", "9290012607", "9290019758", "TERNCY-PP01"]

      51 |         });
      52 |
    > 53 |         expect(duplicated).toHaveLength(0);
         |                            ^
      54 |     });
      55 |
      56 |     it('Should discover devices', async () => {

      at Object.it (test/homeassistant.test.js:53:28)

kiall added 2 commits April 3, 2020 09:25
On certain devices, e.g. GZCGQ01LM, 9290012607, 9290019758, TERNCY-PP01 etc, both
cfg.sensor_illuminance and cfg.sensor_illuminance_lux are applied. As both of these
had the same object_id, only one would show in Home Assistant. Oddly, a mix of both
would apply - e.g. I would get the illuminance value, with the illuminance_lux unit
of 'lx'.
@branch-switcher branch-switcher bot changed the base branch from master to dev April 3, 2020 08:41
@branch-switcher
Copy link

Hello @kiall. The base branch of this pull request has been updated to the dev branch. Please revisit the changes and make sure that there are no conflicts with the new base branch. Thank you for your contributions.

@Koenkk
Copy link
Owner

Koenkk commented Apr 3, 2020

Big thanks!

@Koenkk Koenkk merged commit 1abb5b6 into Koenkk:dev Apr 3, 2020
@kiall kiall deleted the illuminance-conflict branch April 3, 2020 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants