enhomie.philips package#
Subpackages#
- enhomie.philips.params package
- enhomie.philips.plugins package
- Subpackages
- enhomie.philips.plugins.test package
- Submodules
- enhomie.philips.plugins.test.test_button module
- enhomie.philips.plugins.test.test_change module
- enhomie.philips.plugins.test.test_contact module
- enhomie.philips.plugins.test.test_helpers module
- enhomie.philips.plugins.test.test_motion module
- enhomie.philips.plugins.test.test_scene module
- Module contents
- enhomie.philips.plugins.test package
- Submodules
- enhomie.philips.plugins.button module
- enhomie.philips.plugins.change module
- enhomie.philips.plugins.contact module
- enhomie.philips.plugins.helpers module
- enhomie.philips.plugins.motion module
- enhomie.philips.plugins.scene module
- Module contents
- Subpackages
- enhomie.philips.test package
- Submodules
- enhomie.philips.test.test_action module
- enhomie.philips.test.test_device module
- enhomie.philips.test.test_helpers module
- enhomie.philips.test.test_models module
- enhomie.philips.test.test_origin module
- enhomie.philips.test.test_stream module
- enhomie.philips.test.test_surgeon module
- enhomie.philips.test.test_update module
- Module contents
Submodules#
enhomie.philips.action module#
Functions and routines associated with Enasis Network Homie Automate.
This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.
- class enhomie.philips.action.PhueAction(member: HomieMember, origin: HomieOrigin)[source]#
Bases:
HomieAction
Common methods and routines for Homie Automate threads.
- execute(aitem: HomieActionItem) None [source]#
Perform the operation related to Homie service threads.
- Parameters:
aitem – Item containing information for operation.
- class enhomie.philips.action.PhueActionItem(*args: Any, **kwargs: Any)[source]#
Bases:
HomieActionItem
Contain information for sharing using the Python queue.
enhomie.philips.device module#
Functions and routines associated with Enasis Network Homie Automate.
This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.
- class enhomie.philips.device.PhueDevice(homie: Homie, name: str, params: HomieChildParams)[source]#
Bases:
HomieDevice
Contain the relevant attributes from the related source.
enhomie.philips.helpers module#
Functions and routines associated with Enasis Network Homie Automate.
This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.
- enhomie.philips.helpers.action_request(origin: PhueOrigin, type: Literal['scene', 'grouped_light', 'light'], unique: str, *, state: Literal['on', 'off', 'active'] | None = None, color: Color | None = None, level: int | None = None, force: bool = False, change: bool = True, timeout: int | None = None) Response | Literal[True] | None [source]#
Request to execute the action on target from the bridge.
- Parameters:
origin – Child class instance for Homie Automate.
type – Which type of target to perform the action.
unique – Unique identifier within parents system.
state – Determine the state related to the target.
color – Determine the color related to the target.
level – Determine the level related to the target.
force – Override the default for full idempotency.
change – Determine whether the change is executed.
timeout – Timeout waiting for the server response.
- Returns:
Response from upstream request to the server.
- enhomie.philips.helpers.merge_fetch(fetch: dict[str, Any]) dict[str, dict[str, Any]] [source]#
Return the content related to the item in parent system.
- Parameters:
fetch – Dictionary from the origin to be updated.
- Returns:
Content related to the item in parent system.
- enhomie.philips.helpers.merge_find(merge: dict[str, dict[str, Any]], kind: HomieKinds | None = None, unique: str | None = None, label: str | None = None, relate: HomieActionNode | None = None) list[dict[str, Any]] [source]#
Return the content related to the item in parent system.
- Parameters:
merge – Dictionary from the origin to be updated.
kind – Which kind of Homie object will be located.
unique – Unique identifier within parents system.
label – Friendly name or label within the parent.
relate – Child class instance for Homie Automate.
- Returns:
Content related to the item in parent system.
- enhomie.philips.helpers.request_action(origin: PhueOrigin, target: HomieActionNode, *, state: HomieState | None = None, color: str | Color | None = None, level: int | None = None, scene: HomieScene | None = None, force: bool = False, change: bool = True, timeout: int | None = None) None [source]#
Perform the provided action with specified Homie target.
- Parameters:
origin – Child class instance for Homie Automate.
target – Device or group settings will be updated.
state – Determine the state related to the target.
color – Determine the color related to the target.
level – Determine the level related to the target.
scene – Determine the scene related to the target.
force – Override the default for full idempotency.
change – Determine whether the change is executed.
timeout – Timeout waiting for the server response.
enhomie.philips.models module#
Functions and routines associated with Enasis Network Homie Automate.
This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.
- class enhomie.philips.models.PhueDriverHelpers[source]#
Bases:
object
Return the class object that was imported within method.
Note
These are used with the Homie Automate Jinja2 parser.
- classmethod changed() Callable[[...], Any] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- class enhomie.philips.models.PhueDriverModels[source]#
Bases:
object
Return the class object that was imported within method.
- classmethod button() Type[DriverPhueButtonParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod change() Type[DriverPhueChangeParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod contact() Type[DriverPhueContactParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod helpers() Type[PhueDriverHelpers] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod motion() Type[DriverPhueMotionParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod scene() Type[DriverPhueSceneParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- class enhomie.philips.models.PhueModels[source]#
Bases:
object
Return the class object that was imported within method.
- classmethod action() Type[PhueActionItem] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod drivers() Type[PhueDriverModels] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod origin() Type[PhueOriginParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod stream() Type[PhueStreamItem] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod update() Type[PhueUpdateItem] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
enhomie.philips.origin module#
Functions and routines associated with Enasis Network Homie Automate.
This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.
- class enhomie.philips.origin.PhueOrigin(*args: Any, **kwargs: Any)[source]#
Bases:
HomieOrigin
Contain the relevant attributes from the related source.
- property bridge: Bridge#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property family: Literal['philips']#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property fetch: dict[str, Any] | None#
Return the content related to the item in parent system.
- Returns:
Content related to the item in parent system.
- get_action(target: HomieActionNode, *, state: HomieState | None = None, color: str | Color | None = None, level: int | None = None, scene: str | HomieScene | None = None) HomieActionItem [source]#
Return the new item containing information for operation.
Note
This method is identical to same with other origins.
- Parameters:
target – Device or group settings will be updated.
state – Determine the state related to the target.
color – Determine the color related to the target.
level – Determine the level related to the target.
scene – Determine the scene related to the target.
- Returns:
New item containing information for operation.
- get_stream(event: dict[str, Any]) HomieStreamItem [source]#
Return the new item containing information for operation.
- Parameters:
event – Event from the stream for creating object.
- Returns:
New item containing information for operation.
- get_update() HomieUpdateItem [source]#
Return the new item containing information for operation.
- Returns:
New item containing information for operation.
- property merge: dict[str, dict[str, Any]] | None#
Return the content related to the item in parent system.
- Returns:
Content related to the item in parent system.
- refresh(timeout: int | None = None) bool [source]#
Refresh the cached information for the remote upstream.
- Parameters:
timeout – Timeout waiting for the server response.
- Returns:
Boolean indicating the success of the refresh.
- set_action(target: HomieActionNode, aitem: HomieActionItem, force: bool = False, change: bool = True, timeout: int | None = None) bool [source]#
Perform the provided action with specified Homie target.
- Parameters:
target – Device or group settings will be updated.
aitem – Item containing information for operation.
force – Override the default for full idempotency.
change – Determine whether the change is executed.
timeout – Timeout waiting for the server response.
- Returns:
Boolean indicating whether or not was changed.
- set_update(uitem: HomieUpdateBase) bool [source]#
Replace or update internal configuration with provided.
- Parameters:
uitem – Item containing information for operation.
- Returns:
Boolean indicating whether or not was changed.
- source(kind: HomieKinds | None = None, unique: str | None = None, label: str | None = None, relate: HomieActionNode | None = None) dict[str, Any] | None [source]#
Return the content related to the item in parent system.
Note
This method is redundant with other origin classes.
- Parameters:
kind – Which kind of Homie object will be located.
unique – Unique identifier within parents system.
label – Friendly name or label within the parent.
relate – Child class instance for Homie Automate.
- Returns:
Content related to the item in parent system.
enhomie.philips.stream module#
Functions and routines associated with Enasis Network Homie Automate.
This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.
- class enhomie.philips.stream.PhueStream(member: HomieMember, origin: HomieOrigin)[source]#
Bases:
HomieStream
Common methods and routines for Homie Automate threads.
enhomie.philips.surgeon module#
Functions and routines associated with Enasis Network Homie Automate.
This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.
- enhomie.philips.surgeon.surgeon(fetch: dict[str, Any], event: dict[str, Any]) bool [source]#
Process the stream event updating the origin dictionary.
- Parameters:
fetch – Dictionary from the origin to be updated.
event – Event from the stream for updating fetch.
- Returns:
Boolean indicating whether or not was changed.
enhomie.philips.update module#
Functions and routines associated with Enasis Network Homie Automate.
This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.
- class enhomie.philips.update.PhueUpdate(*args: Any, **kwargs: Any)[source]#
Bases:
HomieUpdate
Common methods and routines for Homie Automate threads.
Module contents#
Functions and routines associated with Enasis Network Homie Automate.
This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.
- class enhomie.philips.DriverPhueButton(plugin: HomiePlugin, params: HomieParamsModel)[source]#
Bases:
HomieDriver
Match specific conditions for determining desired state.
- property family: Literal['philips']#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property kinds: list[HomiePluginKinds]#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- occur(sitem: HomieStreamItem) bool [source]#
Return the boolean indicating the conditional outcomes.
- Parameters:
sitem – Item containing information for operation.
- Returns:
Boolean indicating the conditional outcomes.
- property params: DriverPhueButtonParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- class enhomie.philips.DriverPhueChange(plugin: HomiePlugin, params: HomieParamsModel)[source]#
Bases:
HomieDriver
Match specific conditions for determining desired state.
- property family: Literal['philips']#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property kinds: list[HomiePluginKinds]#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property params: DriverPhueChangeParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- class enhomie.philips.DriverPhueContact(plugin: HomiePlugin, params: HomieParamsModel)[source]#
Bases:
HomieDriver
Match specific conditions for determining desired state.
- property family: Literal['philips']#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property kinds: list[HomiePluginKinds]#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- occur(sitem: HomieStreamItem) bool [source]#
Return the boolean indicating the conditional outcomes.
- Parameters:
sitem – Item containing information for operation.
- Returns:
Boolean indicating the conditional outcomes.
- property params: DriverPhueContactParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- class enhomie.philips.DriverPhueMotion(plugin: HomiePlugin, params: HomieParamsModel)[source]#
Bases:
HomieDriver
Match specific conditions for determining desired state.
- property family: Literal['philips']#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property kinds: list[HomiePluginKinds]#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- occur(sitem: HomieStreamItem) bool [source]#
Return the boolean indicating the conditional outcomes.
- Parameters:
sitem – Item containing information for operation.
- Returns:
Boolean indicating the conditional outcomes.
- property params: DriverPhueMotionParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- class enhomie.philips.DriverPhueScene(plugin: HomiePlugin, params: HomieParamsModel)[source]#
Bases:
HomieDriver
Match specific conditions for determining desired state.
- property family: Literal['philips']#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property kinds: list[HomiePluginKinds]#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- occur(sitem: HomieStreamItem) bool [source]#
Return the boolean indicating the conditional outcomes.
- Parameters:
sitem – Item containing information for operation.
- Returns:
Boolean indicating the conditional outcomes.
- property params: DriverPhueSceneParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- class enhomie.philips.PhueAction(member: HomieMember, origin: HomieOrigin)[source]#
Bases:
HomieAction
Common methods and routines for Homie Automate threads.
- execute(aitem: HomieActionItem) None [source]#
Perform the operation related to Homie service threads.
- Parameters:
aitem – Item containing information for operation.
- class enhomie.philips.PhueDevice(homie: Homie, name: str, params: HomieChildParams)[source]#
Bases:
HomieDevice
Contain the relevant attributes from the related source.
- class enhomie.philips.PhueModels[source]#
Bases:
object
Return the class object that was imported within method.
- classmethod action() Type[PhueActionItem] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod drivers() Type[PhueDriverModels] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod origin() Type[PhueOriginParams] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod stream() Type[PhueStreamItem] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- classmethod update() Type[PhueUpdateItem] [source]#
Return the class object that was imported within method.
- Returns:
Class object that was imported within method.
- class enhomie.philips.PhueOrigin(*args: Any, **kwargs: Any)[source]#
Bases:
HomieOrigin
Contain the relevant attributes from the related source.
- property bridge: Bridge#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property family: Literal['philips']#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property fetch: dict[str, Any] | None#
Return the content related to the item in parent system.
- Returns:
Content related to the item in parent system.
- get_action(target: HomieActionNode, *, state: HomieState | None = None, color: str | Color | None = None, level: int | None = None, scene: str | HomieScene | None = None) HomieActionItem [source]#
Return the new item containing information for operation.
Note
This method is identical to same with other origins.
- Parameters:
target – Device or group settings will be updated.
state – Determine the state related to the target.
color – Determine the color related to the target.
level – Determine the level related to the target.
scene – Determine the scene related to the target.
- Returns:
New item containing information for operation.
- get_stream(event: dict[str, Any]) HomieStreamItem [source]#
Return the new item containing information for operation.
- Parameters:
event – Event from the stream for creating object.
- Returns:
New item containing information for operation.
- get_update() HomieUpdateItem [source]#
Return the new item containing information for operation.
- Returns:
New item containing information for operation.
- property merge: dict[str, dict[str, Any]] | None#
Return the content related to the item in parent system.
- Returns:
Content related to the item in parent system.
- refresh(timeout: int | None = None) bool [source]#
Refresh the cached information for the remote upstream.
- Parameters:
timeout – Timeout waiting for the server response.
- Returns:
Boolean indicating the success of the refresh.
- set_action(target: HomieActionNode, aitem: HomieActionItem, force: bool = False, change: bool = True, timeout: int | None = None) bool [source]#
Perform the provided action with specified Homie target.
- Parameters:
target – Device or group settings will be updated.
aitem – Item containing information for operation.
force – Override the default for full idempotency.
change – Determine whether the change is executed.
timeout – Timeout waiting for the server response.
- Returns:
Boolean indicating whether or not was changed.
- set_update(uitem: HomieUpdateBase) bool [source]#
Replace or update internal configuration with provided.
- Parameters:
uitem – Item containing information for operation.
- Returns:
Boolean indicating whether or not was changed.
- source(kind: HomieKinds | None = None, unique: str | None = None, label: str | None = None, relate: HomieActionNode | None = None) dict[str, Any] | None [source]#
Return the content related to the item in parent system.
Note
This method is redundant with other origin classes.
- Parameters:
kind – Which kind of Homie object will be located.
unique – Unique identifier within parents system.
label – Friendly name or label within the parent.
relate – Child class instance for Homie Automate.
- Returns:
Content related to the item in parent system.
- class enhomie.philips.PhueStream(member: HomieMember, origin: HomieOrigin)[source]#
Bases:
HomieStream
Common methods and routines for Homie Automate threads.
- class enhomie.philips.PhueUpdate(*args: Any, **kwargs: Any)[source]#
Bases:
HomieUpdate
Common methods and routines for Homie Automate threads.