Trio-owfs Reference¶
Entry point¶
The base for accessing the 1wire system is an async context:
async with OWFS() as ow:
pass # do whatever
-
async with
trio_owfs.OWFS(**kwargs)¶
Access to an owserver.
-
class
trio_owfs.server.Server(service, host='localhost', port=4304)¶ Encapsulate one server connection.
-
get_bus(*path)¶ Return the bus at this path. Allocate new if not existing.
-
await
drop()¶ Stop talking and delete yourself
-
await
start()¶ Start talking. Returns when the connection is established, raises an error if not possible.
TODO: if the connection subsequently drops, it’s re-established transparently.
-
Buses.
-
class
trio_owfs.bus.Bus(server, *path)¶ Describes one bus.
-
delocate()¶ This bus can no longer be found
-
await
attr_get(*attr)¶ Read this attribute
-
await
attr_set(*attr, value)¶ Write this attribute
-
Devices.
-
class
trio_owfs.device.Device(service, id)¶ Base class for devices.
A device may or may not have a known location.
-
locate(bus)¶ The device has been seen here.
-
delocate(bus)¶ The device is no longer located here.
-
await
attr_get(*attr)¶ Read this attribute
-
await
attr_set(*attr, value)¶ Write this attribute
-
classmethod await
setup_struct(server)¶ Read the device’s structural data from OWFS and add methods to access the fields
-
Events: whatever is happening on the bus
-
class
trio_owfs.event.Event¶ Base class for all events
-
class
trio_owfs.event.ServerEvent¶ Base class for all server-related events
-
class
trio_owfs.event.ServerRegistered(server)¶ A new known server appears. The server is not yet connected!
-
class
trio_owfs.event.ServerConnected(server)¶ We have connected to a server
-
class
trio_owfs.event.ServerDisconnected(server)¶ We have disconnected from a server
-
class
trio_owfs.event.ServerDeregistered(server)¶ This server is no longer known
-
class
trio_owfs.event.BusEvent¶ Base class for all Bus-related events
-
class
trio_owfs.event.BusAdded(bus)¶ The Bus has been created. Its location is not yet known!
-
class
trio_owfs.event.BusAdded_Path(*path)¶ Not an event. Used for storing the bus path for comparisons in tests.
-
class
trio_owfs.event.BusDeleted(bus)¶ The Bus has been deleted
-
class
trio_owfs.event.DeviceEvent¶ Base class for all device-related events
-
class
trio_owfs.event.DeviceAdded(device)¶ The device has been created. Its location is not yet known!
-
class
trio_owfs.event.DeviceDeleted(device)¶ The device has been deleted
-
class
trio_owfs.event.DeviceLocated(device)¶ The device has been found
-
class
trio_owfs.event.DeviceNotFound(device)¶ The device’s location is no longer known