diff --git a/README.md b/README.md index 74d45ba..a0d5141 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,11 @@ This is a hard fork of [xMrVizzy/philips-airpurifier](https://github.com/xMrVizzy/philips-airpurifier). -`ha-philips-purifier_http` is a custom Home Assistant component that enables you to control your Philips Air Purifier devices. +This is a custom Home Assistant component that enables you to control your Philips Air Purifier devices. For now, it supports only older models that use the HTTP protocol for communication. CoAP support comming soon. :) ## Installation - ### Install manually Download the `philips_airpurifier_http` folder from this repo and place it in your `custom_components` folder @@ -49,7 +48,7 @@ Set the device mode (if supported) | entity_id | `"fan.living_room"` | _Required_ | Name(s) of the entities to set mode | | preset_mode | `"allergen"` | _Required_ | One of "auto", "allergen", "sleep", "bacteria", "night". | -### `philips_airpurifier.set_function` +### `philips_airpurifier_http.set_function` Set the device function (if supported) @@ -76,7 +75,7 @@ Set the device light brightness | entity_id | `"fan.living_room"` | _Required_ | Name(s) of the entities to set light brightness | | level | `50` | _Required_ | One of 0, 25, 50, 75, 100. Turns off the display light if level is 0. | -### `philips_airpurifier.set_child_lock` +### `philips_airpurifier_http.set_child_lock` Set the device child lock on or off @@ -85,7 +84,7 @@ Set the device child lock on or off | entity_id | `"fan.living_room"` | _Required_ | Name(s) of the entities to set child lock | | lock | `true` | _Required_ | true or false | -### `philips_airpurifier.set_timer` +### `philips_airpurifier_http.set_timer` Set the device off time @@ -94,7 +93,7 @@ Set the device off time | entity_id | `"fan.living_room"` | _Required_ | Name(s) of the entities to set off timer | | hours | `5` | _Required_ | Hours between 0 and 12 | -### `philips_airpurifier.set_display_light` +### `philips_airpurifier_http.set_display_light` Set the device display light on or off @@ -103,14 +102,14 @@ Set the device display light on or off | entity_id | `"fan.living_room"` | _Required_ | Name(s) of the entities to set display light | | light | `true` | _Required_ | true or false | -### `philips_airpurifier.set_used_index` +### `philips_airpurifier_http.set_used_index` Sets the device used index(IAI or PM2.5) -| Field | Value | Necessity | Description | -| --------- | ------------------- | ---------- | -------------------------------------------- | -| entity_id | `"fan.living_room"` | _Required_ | Name(s) of the entities to set display light | -| used_index | `"IAI"` | _Required_ | One of "IAI" or "PM2.5". | +| Field | Value | Necessity | Description | +| ---------- | ------------------- | ---------- | -------------------------------------------- | +| entity_id | `"fan.living_room"` | _Required_ | Name(s) of the entities to set display light | +| used_index | `"IAI"` | _Required_ | One of "IAI" or "PM2.5". | ## Meta diff --git a/custom_components/philips_airpurifier_http/const.py b/custom_components/philips_airpurifier_http/const.py index 8b5f6e3..6250d19 100644 --- a/custom_components/philips_airpurifier_http/const.py +++ b/custom_components/philips_airpurifier_http/const.py @@ -1,4 +1,4 @@ -""" philips_airpurifier constants""" +""" philips_airpurifier_http constants""" # Integration setup DOMAIN = "philips_airpurifier_http" diff --git a/custom_components/philips_airpurifier_http/fan.py b/custom_components/philips_airpurifier_http/fan.py index f78efea..0855403 100644 --- a/custom_components/philips_airpurifier_http/fan.py +++ b/custom_components/philips_airpurifier_http/fan.py @@ -118,9 +118,6 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= client = await hass.async_add_executor_job( lambda: HTTPAirClient(config[CONF_HOST], False) ) - unique_id = None - - wifi = await hass.async_add_executor_job(client.get_wifi) device = PhilipsAirPurifierFan(hass, client, name) @@ -349,7 +346,7 @@ async def async_set_preset_mode(self, preset_mode: str) -> None: await self._async_set_values({PHILIPS_MODE: philips_mode}) else: _LOGGER.warning('Unsupported preset mode "%s"', preset_mode) - + async def async_set_used_index(self, used_index: str) -> None: """Set the used_index of the fan.""" philips_used_index = self._find_key(USED_INDEX_MAP, used_index) diff --git a/custom_components/philips_airpurifier_http/services.yaml b/custom_components/philips_airpurifier_http/services.yaml index d41d8b1..126eb34 100644 --- a/custom_components/philips_airpurifier_http/services.yaml +++ b/custom_components/philips_airpurifier_http/services.yaml @@ -1,4 +1,4 @@ -# philips-airpurifier custom services. +# philips_airpurifier_http custom services. set_function: description: Set the device function (if supported)