# Table of Contents * [yahuelib](#yahuelib) * [yahuelib.controller](#yahuelib.controller) * [LightController](#yahuelib.controller.LightController) * [check\_reachable](#yahuelib.controller.LightController.check_reachable) * [check\_on](#yahuelib.controller.LightController.check_on) * [set\_on](#yahuelib.controller.LightController.set_on) * [get\_brightness](#yahuelib.controller.LightController.get_brightness) * [set\_brightness](#yahuelib.controller.LightController.set_brightness) * [get\_hue](#yahuelib.controller.LightController.get_hue) * [set\_hue](#yahuelib.controller.LightController.set_hue) * [get\_saturation](#yahuelib.controller.LightController.get_saturation) * [set\_saturation](#yahuelib.controller.LightController.set_saturation) * [get\_color\_temperature](#yahuelib.controller.LightController.get_color_temperature) * [set\_color\_temperature](#yahuelib.controller.LightController.set_color_temperature) * [alert](#yahuelib.controller.LightController.alert) * [alert\_long](#yahuelib.controller.LightController.alert_long) * [GroupController](#yahuelib.controller.GroupController) * [check\_any\_on](#yahuelib.controller.GroupController.check_any_on) * [check\_all\_on](#yahuelib.controller.GroupController.check_all_on) * [set\_all\_on](#yahuelib.controller.GroupController.set_all_on) * [get\_brightness](#yahuelib.controller.GroupController.get_brightness) * [set\_brightness](#yahuelib.controller.GroupController.set_brightness) * [get\_hue](#yahuelib.controller.GroupController.get_hue) * [set\_hue](#yahuelib.controller.GroupController.set_hue) * [get\_saturation](#yahuelib.controller.GroupController.get_saturation) * [set\_saturation](#yahuelib.controller.GroupController.set_saturation) * [get\_color\_temperature](#yahuelib.controller.GroupController.get_color_temperature) * [set\_color\_temperature](#yahuelib.controller.GroupController.set_color_temperature) * [alert](#yahuelib.controller.GroupController.alert) * [alert\_long](#yahuelib.controller.GroupController.alert_long) * [MotionSensor](#yahuelib.controller.MotionSensor) * [check\_on](#yahuelib.controller.MotionSensor.check_on) * [set\_on](#yahuelib.controller.MotionSensor.set_on) * [check\_reachable](#yahuelib.controller.MotionSensor.check_reachable) * [get\_battery](#yahuelib.controller.MotionSensor.get_battery) * [get\_sensitivity](#yahuelib.controller.MotionSensor.get_sensitivity) * [set\_sensitivity](#yahuelib.controller.MotionSensor.set_sensitivity) * [get\_sensitivitymax](#yahuelib.controller.MotionSensor.get_sensitivitymax) * [check\_ledindication](#yahuelib.controller.MotionSensor.check_ledindication) * [set\_ledindication](#yahuelib.controller.MotionSensor.set_ledindication) * [get\_presence](#yahuelib.controller.MotionSensor.get_presence) * [yahuelib.utils](#yahuelib.utils) * [rgb\_to\_hsv](#yahuelib.utils.rgb_to_hsv) * [kelvin\_to\_mired](#yahuelib.utils.kelvin_to_mired) * [yahuelib.exceptions](#yahuelib.exceptions) * [DeviceNotFound](#yahuelib.exceptions.DeviceNotFound) * [APIError](#yahuelib.exceptions.APIError) # yahuelib # yahuelib.controller ## LightController Objects ```python class LightController(_BaseController) ``` Control a Philips Hue Light using the API of your Hue Bridge. **Arguments**: - `number: int` - The number of your light - `bridge_ip_address: str` - The IP address of your Hue Bridge - `bridge_api_user: str` - The user used to authenticate to the API Use the class method `.from_name(name:str, ...)` to use the name of a light instead of the number. #### check\_reachable ```python def check_reachable() -> bool ``` Check if the light is reachable #### check\_on ```python def check_on() -> bool ``` Check if the light is on #### set\_on ```python def set_on(on: bool) ``` Turn the light on/off #### get\_brightness ```python def get_brightness() -> int ``` Get the brightness #### set\_brightness ```python def set_brightness(brightness: int) ``` Set the brightness (`0` - `254`) #### get\_hue ```python def get_hue() -> int ``` Get the hue #### set\_hue ```python def set_hue(hue: int) ``` Set the hue (0 - 65535) #### get\_saturation ```python def get_saturation() -> int ``` Get the saturation #### set\_saturation ```python def set_saturation(saturation: int) ``` Set the saturation (`0` - `254`) #### get\_color\_temperature ```python def get_color_temperature() -> int ``` Get the white color temperature in Mired #### set\_color\_temperature ```python def set_color_temperature(mired: int) ``` Set the white color temperature in Mired (`154` - `500`) #### alert ```python def alert() ``` Flash the light once. #### alert\_long ```python def alert_long() ``` Flash the light for 10 seconds. ## GroupController Objects ```python class GroupController(_BaseController) ``` Control a Philips Hue Light Group (Room/Zone) using the API of your Hue Bridge. **Arguments**: - `number: int` - The number of your light group - `bridge_ip_address: str` - The IP address of your Hue Bridge - `bridge_api_user: str` - The user used to authenticate to the API Use the class method `.from_name(name:str, ...)` to use the name of a group instead of the number. #### check\_any\_on ```python def check_any_on() -> bool ``` Check if any light in this group is on #### check\_all\_on ```python def check_all_on() -> bool ``` Check if all lights in this group are on #### set\_all\_on ```python def set_all_on(on: bool) ``` Turn on/off all lights in this group #### get\_brightness ```python def get_brightness() ``` Get the last set brightness in this group #### set\_brightness ```python def set_brightness(brightness: int) ``` Set the brightness (`0` - `254`) of all lights in this group #### get\_hue ```python def get_hue() -> int ``` Get the last set hue in this group #### set\_hue ```python def set_hue(hue: int) ``` Set the hue (`0` - `65535`) of all lights in this group #### get\_saturation ```python def get_saturation() -> int ``` Get the last set saturation in this group #### set\_saturation ```python def set_saturation(saturation: int) ``` Set the saturation (`0` - `254`) of all lights in this group #### get\_color\_temperature ```python def get_color_temperature() -> int ``` Get the last set white color temperature in Mired #### set\_color\_temperature ```python def set_color_temperature(mired: int) ``` Set the white color temperature in Mired (`154` - `500`) for all lights in this group #### alert ```python def alert() ``` Flash all lights in the group once. #### alert\_long ```python def alert_long() ``` Flash all lights in the group for 10 seconds. ## MotionSensor Objects ```python class MotionSensor(_BaseController) ``` #### check\_on ```python def check_on() -> bool ``` Check if the sensor is on #### set\_on ```python def set_on(on: bool) ``` Turn the sensor on/off #### check\_reachable ```python def check_reachable() -> bool ``` Check if the sensor is reachable #### get\_battery ```python def get_battery() -> int ``` Get the current charge of the battery in percent #### get\_sensitivity ```python def get_sensitivity() -> int ``` Get the sensitivity of the sensor #### set\_sensitivity ```python def set_sensitivity(sensitivity: int) ``` Set the sensitivity of the sensor #### get\_sensitivitymax ```python def get_sensitivitymax() -> int ``` Get the maximum sensititvity of the sensor #### check\_ledindication ```python def check_ledindication() -> bool ``` Check if the LED indication is turned on or off #### set\_ledindication ```python def set_ledindication(on: bool) ``` Turn the LED indicator on/off #### get\_presence ```python def get_presence() -> bool ``` Check if the motion sensor detected the presence of someone in it's reach # yahuelib.utils #### rgb\_to\_hsv ```python def rgb_to_hsv(r: int, g: int, b: int) -> tuple ``` Convert RGB colors `(255, 220, 100)` to Philips Hue's hue, saturation and brightness values `(8456, 149, 245)` imprecisely #### kelvin\_to\_mired ```python def kelvin_to_mired(kelvin: int) ``` Convert the color temperature from Kelvin to Mired # yahuelib.exceptions ## DeviceNotFound Objects ```python class DeviceNotFound(Exception) ``` `DeviceNotFound` Exception ## APIError Objects ```python class APIError(Exception) ``` Generic `APIError` Exception