caspia.gateway.rules package

Submodules

caspia.gateway.rules.activate module

caspia.gateway.rules.activate.activate_rule(rule, context)[source]
caspia.gateway.rules.activate.activate_rules(requested_rules, context)[source]

caspia.gateway.rules.activate_button module

caspia.gateway.rules.activate_button.activate_on_do_rule(rule: caspia.meadow.rules.on_do.OnDoRule, context) → bool[source]
caspia.gateway.rules.activate_button.activate_rule_on_button_characteristic_notification(rule, context)[source]
caspia.gateway.rules.activate_button.activate_rule_on_button_event(rule, context)[source]

Activate rule, where rule.on is ButtonClickEvent or ButtonHoldEvent.

caspia.gateway.rules.activate_button.create_button_event(trigger, pollen_data, cancelling=True)[source]
caspia.gateway.rules.activate_button.create_pollen_data_for_button_observer(observer, observable, context)[source]

Return (type, address, data), for example (‘request’, 0x1C, b’test’) or None if not supported.

caspia.gateway.rules.activate_group module

caspia.gateway.rules.activate_group.activate_light_group_attach_rule(rule, context)[source]

caspia.gateway.rules.context module

class caspia.gateway.rules.context.RuleActivationContext(loop, configurator, rules_filter=<RulesFilter.ALL: 'all'>)[source]

Bases: dict

async cleanup()[source]
clear() → None. Remove all items from D.
copy() → a shallow copy of D
fromkeys()

Create a new dictionary with keys from iterable and values set to value.

get()

Return the value for key if key is in the dictionary, else default.

get_lightgroup_behavior(group_light, create=True)[source]
items() → a set-like object providing a view on D's items
keys() → a set-like object providing a view on D's keys
property lightgroup_behaviors
property lookup
on_cleanup(func)[source]
pop(k[, d]) → v, remove specified key and return the corresponding value.

If key is not found, d is returned if given, otherwise KeyError is raised

popitem() → (k, v), remove and return some (key, value) pair as a

2-tuple; but raise KeyError if D is empty.

setdefault()

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update([E, ]**F) → None. Update D from dict/iterable E and F.

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values() → an object providing a view on D's values

caspia.gateway.rules.filter module

class caspia.gateway.rules.filter.RulesFilter[source]

Bases: enum.Enum

An enumeration.

ALL = 'all'
BASIC = 'basic'
NO = 'no'

caspia.gateway.rules.lightgroup module

class caspia.gateway.rules.lightgroup.LightGroupBehavior(group_light, context)[source]

Bases: object

Implements logic for driving set of lights that are being part of a group light.

add(light)[source]

Add given light service to the group.

classmethod get_group_identifiers_range(context)[source]

Get range of assigned group identifiers for this gateway.

classmethod get_next_identifier(context)[source]

Get next available group identifier and reserve it.

is_master(light)[source]

Return true if the given light is master of the group.

Module contents