def gateway(sid):
    'Convert sid to a gateway.'
    sid = str(sid).replace(':', '').lower()
    for gateway in xiaomi.gateways.values():
        if (gateway.sid == sid):
            return gateway
    raise vol.Invalid('Unknown gateway sid {}'.format(sid))
Convert sid to a gateway.
def gateway(sid):
    
    sid = str(sid).replace(':', ).lower()
    for gateway in xiaomi.gateways.values():
        if (gateway.sid == sid):
            return gateway
    raise vol.Invalid('Unknown gateway sid {}'.format(sid))