Did I find the right examples for you? yes no

All Samples(4)  |  Call(3)  |  Derive(0)  |  Import(1)

        def validate_address(address):
    m = re.match("^%s$" % ADDRESS_REGEXP, address)
    if not m:
        raise ValueError("Unsupported address: %s" % address)

    num = int(m.group(1))
    if num > 16 or num < 1:
        raise ValueError("Unsupported address: %s" % address)
        


src/h/a/hautomation_x10-0.10.5/hautomation_x10/cmds.py   hautomation_x10(Download)
from utils import validate_address
 
 
def pl_switch(self, address, value):
    if value not in ["on", "off"]:
        raise ValueError("Switch value must be 'on' or 'off'")
 
    validate_address(address)
def pl_dim(self, address, value):
    if int(value) not in range(0, 32):
        raise ValueError("Dim value must be in the range(0, 32)")
 
    validate_address(address)
def pl_bri(self, address, value):
    if int(value) not in range(0, 32):
        raise ValueError("Dim value must be in the range(0, 32)")
 
    validate_address(address)