Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.numato Namespace Reference

Namespaces

 binary_sensor
 
 sensor
 
 switch
 

Classes

class  NumatoAPI
 

Functions

def adc_port_number (num)
 
def float_range (rng)
 
def int_range (rng)
 
bool setup (HomeAssistant hass, ConfigType config)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
 ADC_SCHEMA
 
string CONF_DEVICE_ID = "id"
 
string CONF_DEVICES = "devices"
 
string CONF_DISCOVER = "discover"
 
string CONF_DST_RANGE = "destination_range"
 
string CONF_DST_UNIT = "unit"
 
string CONF_INVERT_LOGIC = "invert_logic"
 
string CONF_PORTS = "ports"
 
string CONF_SRC_RANGE = "source_range"
 
 CONFIG_SCHEMA
 
string DATA_API = "api"
 
string DATA_PORTS_IN_USE = "ports_in_use"
 
list DEFAULT_DEV = [f"/dev/ttyACM{i}" for i in range(10)]
 
list DEFAULT_DST_RANGE = [0.0, 100.0]
 
bool DEFAULT_INVERT_LOGIC = False
 
list DEFAULT_SRC_RANGE = [0, 1024]
 
 DEVICE_SCHEMA
 
string DOMAIN = "numato"
 
 IO_PORTS_SCHEMA
 
 PORT_RANGE = range(1, 8)
 
 PORTS_SCHEMA = vol.Schema({cv.positive_int: cv.string})
 

Detailed Description

Support for controlling GPIO pins of a Numato Labs USB GPIO expander.

Function Documentation

◆ adc_port_number()

def homeassistant.components.numato.adc_port_number (   num)
Validate input number to be in the range of ADC enabled ports.

Definition at line 74 of file __init__.py.

◆ float_range()

def homeassistant.components.numato.float_range (   rng)
Validate the input array to describe a range by two floats.

Definition at line 59 of file __init__.py.

◆ int_range()

def homeassistant.components.numato.int_range (   rng)
Validate the input array to describe a range by two integers.

Definition at line 48 of file __init__.py.

◆ setup()

bool homeassistant.components.numato.setup ( HomeAssistant  hass,
ConfigType  config 
)
Initialize the numato integration.

Discovers available Numato devices and loads the binary_sensor, sensor and
switch platforms.

Returns False on error during device discovery (e.g. duplicate ID),
otherwise returns True.

No exceptions should occur, since the platforms are initialized on a best
effort basis, which means, errors are handled locally.

Definition at line 125 of file __init__.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.numato._LOGGER = logging.getLogger(__name__)
private

Definition at line 25 of file __init__.py.

◆ ADC_SCHEMA

homeassistant.components.numato.ADC_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(CONF_NAME): cv.string,
4  vol.Optional(CONF_SRC_RANGE, default=DEFAULT_SRC_RANGE): int_range,
5  vol.Optional(CONF_DST_RANGE, default=DEFAULT_DST_RANGE): float_range,
6  vol.Optional(CONF_DST_UNIT, default=PERCENTAGE): cv.string,
7  }
8 )

Definition at line 85 of file __init__.py.

◆ CONF_DEVICE_ID

string homeassistant.components.numato.CONF_DEVICE_ID = "id"

Definition at line 32 of file __init__.py.

◆ CONF_DEVICES

string homeassistant.components.numato.CONF_DEVICES = "devices"

Definition at line 31 of file __init__.py.

◆ CONF_DISCOVER

string homeassistant.components.numato.CONF_DISCOVER = "discover"

Definition at line 30 of file __init__.py.

◆ CONF_DST_RANGE

string homeassistant.components.numato.CONF_DST_RANGE = "destination_range"

Definition at line 35 of file __init__.py.

◆ CONF_DST_UNIT

string homeassistant.components.numato.CONF_DST_UNIT = "unit"

Definition at line 36 of file __init__.py.

◆ CONF_INVERT_LOGIC

string homeassistant.components.numato.CONF_INVERT_LOGIC = "invert_logic"

Definition at line 29 of file __init__.py.

◆ CONF_PORTS

string homeassistant.components.numato.CONF_PORTS = "ports"

Definition at line 33 of file __init__.py.

◆ CONF_SRC_RANGE

string homeassistant.components.numato.CONF_SRC_RANGE = "source_range"

Definition at line 34 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.numato.CONFIG_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  DOMAIN: {
4  CONF_DEVICES: vol.All(cv.ensure_list, [DEVICE_SCHEMA]),
5  vol.Optional(CONF_DISCOVER, default=DEFAULT_DEV): vol.All(
6  cv.ensure_list, [cv.string]
7  ),
8  },
9  },
10  extra=vol.ALLOW_EXTRA,
11 )

Definition at line 112 of file __init__.py.

◆ DATA_API

string homeassistant.components.numato.DATA_API = "api"

Definition at line 45 of file __init__.py.

◆ DATA_PORTS_IN_USE

string homeassistant.components.numato.DATA_PORTS_IN_USE = "ports_in_use"

Definition at line 44 of file __init__.py.

◆ DEFAULT_DEV

list homeassistant.components.numato.DEFAULT_DEV = [f"/dev/ttyACM{i}" for i in range(10)]

Definition at line 40 of file __init__.py.

◆ DEFAULT_DST_RANGE

list homeassistant.components.numato.DEFAULT_DST_RANGE = [0.0, 100.0]

Definition at line 39 of file __init__.py.

◆ DEFAULT_INVERT_LOGIC

bool homeassistant.components.numato.DEFAULT_INVERT_LOGIC = False

Definition at line 37 of file __init__.py.

◆ DEFAULT_SRC_RANGE

list homeassistant.components.numato.DEFAULT_SRC_RANGE = [0, 1024]

Definition at line 38 of file __init__.py.

◆ DEVICE_SCHEMA

homeassistant.components.numato.DEVICE_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(CONF_ID): cv.positive_int,
4  CONF_BINARY_SENSORS: IO_PORTS_SCHEMA,
5  CONF_SWITCHES: IO_PORTS_SCHEMA,
6  CONF_SENSORS: {CONF_PORTS: {adc_port_number: ADC_SCHEMA}},
7  }
8 )

Definition at line 103 of file __init__.py.

◆ DOMAIN

string homeassistant.components.numato.DOMAIN = "numato"

Definition at line 27 of file __init__.py.

◆ IO_PORTS_SCHEMA

homeassistant.components.numato.IO_PORTS_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(CONF_PORTS): PORTS_SCHEMA,
4  vol.Optional(CONF_INVERT_LOGIC, default=DEFAULT_INVERT_LOGIC): cv.boolean,
5  }
6 )

Definition at line 96 of file __init__.py.

◆ PORT_RANGE

homeassistant.components.numato.PORT_RANGE = range(1, 8)

Definition at line 42 of file __init__.py.

◆ PORTS_SCHEMA

homeassistant.components.numato.PORTS_SCHEMA = vol.Schema({cv.positive_int: cv.string})

Definition at line 94 of file __init__.py.