Skip to content

Commit

Permalink
♻️ add support air-monitor (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed May 11, 2021
1 parent 95d8c66 commit 60cab80
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ doamin.your_entity_id:
- [toilet](https://miot-spec.org/miot-spec-v2/spec/service?type=urn:miot-spec-v2:service:toilet:00007877)
- [air_quality](https://www.home-assistant.io/integrations/air_quality)
- [air-monitor](https://miot-spec.org/miot-spec-v2/spec/service?type=urn:miot-spec-v2:device:air-monitor:0000A008)
- [environment](https://miot-spec.org/miot-spec-v2/spec/service?type=urn:miot-spec-v2:service:environment:0000780A)
- [switch](https://www.home-assistant.io/integrations/switch)
- [massager](https://miot-spec.org/miot-spec-v2/spec/service?type=urn:miot-spec-v2:service:massager:0000788E)
- [outlet](https://miot-spec.org/miot-spec-v2/spec/service?type=urn:miot-spec-v2:service:switch:0000780C)
Expand Down
1 change: 1 addition & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ doamin.your_entity_id:
- [toilet](https://miot-spec.org/miot-spec-v2/spec/service?type=urn:miot-spec-v2:service:toilet:00007877)
- [air_quality](https://www.home-assistant.io/integrations/air_quality)
- [air-monitor](https://miot-spec.org/miot-spec-v2/spec/service?type=urn:miot-spec-v2:device:air-monitor:0000A008)
- [environment](https://miot-spec.org/miot-spec-v2/spec/service?type=urn:miot-spec-v2:service:environment:0000780A)
- [switch](https://www.home-assistant.io/integrations/switch)
- [massager](https://miot-spec.org/miot-spec-v2/spec/service?type=urn:miot-spec-v2:service:massager:0000788E)
- [outlet](https://miot-spec.org/miot-spec-v2/spec/service?type=urn:miot-spec-v2:service:switch:0000780C)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/xiaomi_miot/air_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
miot = config.get('miot_type')
if miot:
spec = await MiotSpec.async_from_type(hass, miot)
for srv in spec.get_services('air_monitor'):
for srv in spec.get_services('air_monitor', 'environment'):
if not srv.get_property('pm2_5_density', 'co2_density'):
continue
cfg = {
Expand Down

0 comments on commit 60cab80

Please sign in to comment.