velbus package

Subpackages

Submodules

velbus.controller module

author:Thomas Delaet <thomas@delaet.org>
class velbus.controller.Controller(port)[source]

Bases: object

Velbus Bus connection controller

async_scan()[source]
feed_parser(data)[source]

Feed parser with new data

Returns:None
get_module(address)[source]

Returns module at address

get_modules()[source]

Returns a list of modules

Returns:list
get_modules_loaded()[source]

Returns a list of loaded modules

Returns:list
new_binary_message(message)[source]
new_message(message)[source]
Returns:None
parse(binary_message)[source]
Returns:velbus.Message or None
scan(callback=None)[source]

Scan the bus and call the callback when a new module is discovered

Returns:None
send(message, callback=None)[source]
Returns:None
send_binary(binary_message, callback=None)[source]
Returns:None
stop()[source]

Stop velbus

subscribe(subscriber)[source]
Returns:None
subscribe_module(subscriber, category)[source]
Returns:None
sync_clock()[source]

This will send all the needed messages to sync the clock

unsubscribe(subscriber)[source]
Returns:None
unsubscribe_module(subscriber, category)[source]
Returns:None

velbus.message module

author:Thomas Delaet <thomas@delaet.org>
class velbus.message.Message(address=None)[source]

Bases: object

Base Velbus message

byte_to_channel(byte)[source]
Returns:int
byte_to_channels(byte)[source]
Returns:list(int)
channels_to_byte(channels)[source]
Returns:int
data_to_binary()[source]
Returns:bytes
needs_data(data, length)[source]
Returns:None
needs_firmware_priority(priority)[source]
Returns:None
needs_fixed_byte(byte, value)[source]
Returns:None
needs_high_priority(priority)[source]
Returns:None
needs_low_priority(priority)[source]
Returns:None
needs_no_data(data)[source]
Returns:None
needs_no_rtr(rtr)[source]
Returns:None
needs_one_channel(channels)[source]
Returns:None
needs_rtr(rtr)[source]
Returns:None
needs_valid_channel(channel, maximum)[source]
Returns:None
parser_error(message)[source]
Returns:None
populate(priority, address, rtr, data)[source]
Returns:None
set_address(address)[source]
Returns:None
set_attributes(priority, address, rtr)[source]
Returns:None
set_defaults(address)[source]

Set defaults

If a message has different than low priority or NO_RTR set, then this method needs override in subclass

Returns:None
set_firmware_priority()[source]
Returns:None
set_high_priority()[source]
Returns:None
set_low_priority()[source]
Returns:None
set_no_rtr()[source]
Returns:None
set_rtr()[source]
Returns:None
to_base64()[source]
Returns:str
to_binary()[source]
Returns:bytes
to_json()[source]

Dump object structure to JSON

This method should be overridden in subclasses to include more than just generic attributes

Returns:str
to_json_basic()[source]

Create JSON structure with generic attributes

Returns:dict
exception velbus.message.ParserError[source]

Bases: Exception

Error when invalid message is received

velbus.module module

author:Thomas Delaet <thomas@delaet.org>
class velbus.module.Module(module_type, module_name, module_address, controller)[source]

Bases: object

Abstract class for Velbus hardware modules.

get_categories(channel)[source]

Get type of functionality of channel

Returns:str
get_module_address()[source]

Returns the module address

Returns:int
get_module_name()[source]

Returns the module model name

Returns:str
get_module_type_name()[source]
get_name(channel)[source]

Get name for one of the channels

Returns:str
get_type()[source]
light_is_buttonled(channel)[source]
load(callback)[source]

Retrieve names of channels

loading_in_progress()[source]
number_of_channels()[source]

Retrieve the number of available channels in this module

Returns:int
on_message(message)[source]

Process received message

velbus.parser module

author:Thomas Delaet <thomas@delaet.org>
class velbus.parser.VelbusParser(controller)[source]

Bases: object

Transform Velbus message from wire format to Message object

extract_packet()[source]

Extract packet from buffer

feed(data)[source]

Add new incoming data to buffer and try to process

next_packet()[source]

Process next packet if present

parse(data)[source]
Returns:None
parse_binary_message(data)[source]
valid_body_waiting()[source]

Check if a valid body is waiting in buffer

valid_header_waiting()[source]

Check if a valid header is waiting in buffer

Module contents

author:Thomas Delaet <thomas@delaet.org>