caspia.gateway package¶
Subpackages¶
- caspia.gateway.cli package
- caspia.gateway.config package
- caspia.gateway.monitor package
- caspia.gateway.rules package
- caspia.gateway.services package
- Subpackages
- caspia.gateway.services.meters package
- caspia.gateway.services.sensors package
- Subpackages
- caspia.gateway.services.sensors.carbondioxide package
- caspia.gateway.services.sensors.humidity package
- caspia.gateway.services.sensors.light package
- caspia.gateway.services.sensors.temperature package
- Submodules
- caspia.gateway.services.sensors.temperature.analog module
- caspia.gateway.services.sensors.temperature.mcp980x module
- caspia.gateway.services.sensors.temperature.scd30 module
- caspia.gateway.services.sensors.temperature.service module
- caspia.gateway.services.sensors.temperature.sht2x module
- Module contents
- Module contents
- Subpackages
- Submodules
- caspia.gateway.services.base module
- caspia.gateway.services.blinds module
- caspia.gateway.services.button module
- caspia.gateway.services.door module
- caspia.gateway.services.fan module
- caspia.gateway.services.irrigation module
- caspia.gateway.services.light module
- caspia.gateway.services.lockmechanism module
- caspia.gateway.services.outlet module
- caspia.gateway.services.pump module
- caspia.gateway.services.relaybased module
- caspia.gateway.services.serial module
- Module contents
- Subpackages
Submodules¶
caspia.gateway.cidmanagement module¶
-
class
caspia.gateway.cidmanagement.CidManagement(cache_path: pathlib.Path, config=None, maxcid=511)[source]¶ Bases:
objectManages cid assignments on a can network.
CAN ID lease (assignment) process:
- The search of available cids is narrowed to cids allowed
for that node.
- If there is an existing lease for the node within the allowed cids
range, that cid is assigned/leased again.
- If there is a cid reservation for that node, that cid will be
leased to the node.
If there is any available cid, that cid will be leased to the node.
- If there is cid reservation for some other node (which is not leased yet),
that cid will be leased to the node.
Otherwise CanIDReservationError will be raised.
-
cid_of(name, *, reserved=False)[source]¶ Return cid of a node with given name.
By default searches for nodes having this cid leased. If reserved is True, searches also for nodes having the cid reserved.
-
class
caspia.gateway.cidmanagement.Reservation(cid: int, node: str, leased: bool)[source]¶ Bases:
objectCan ID reservation.
When a node has a cid reservation, it means, that there is a preference of that node having the cid in future. No guarantees included. On the other side, if the reservation is leased, it is guaranted that the cid won’t be assigned to some other node.
caspia.gateway.configurator module¶
caspia.gateway.errors module¶
-
exception
caspia.gateway.errors.CanIDReservationError[source]¶ Bases:
Exception-
args¶
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
exception
caspia.gateway.errors.ConfigurationError[source]¶ Bases:
Exception-
args¶
-
property
messages¶
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
caspia.gateway.gateway module¶
-
class
caspia.gateway.gateway.CaspiaGateway(*, name, connection, config_path, storage_path, pollen_client, consumer_conn, rules_filter=<RulesFilter.ALL: 'all'>)[source]¶ Bases:
caspia.meadow.client.gateway.GatewayBridge between Caspia CAN Components and Meadow Services.
-
add(services: Iterable[Union[GatewayServiceMixin, caspia.meadow.services.ServiceBase]], update_immediately=False)¶ Register service(s) for the gateway.
-
property
busy¶
-
property
connection¶
-
property
hwid_map¶
-
async
on_gateway_registered()¶
-
async
prepare()¶
-
remove(services: Iterable[Union[GatewayServiceMixin, caspia.meadow.services.ServiceBase]], update_immediately=False)¶ Remove service(s) from the gateway.
-
property
services¶ All registered services for the gateway.
-