Beispiel #1
0
def device_fixture(location):
    """Fixture representing devices loaded."""
    item = Mock(DeviceEntity)
    item.device_id = "743de49f-036f-4e9c-839a-2f89d57607db"
    item.name = "GE In-Wall Smart Dimmer"
    item.label = "Front Porch Lights"
    item.location_id = location.location_id
    item.capabilities = [
        "switch", "switchLevel", "refresh", "indicator", "sensor", "actuator",
        "healthCheck", "light"
    ]
    item.components = {"main": item.capabilities}
    item.status = Mock(DeviceStatus)
    return item
Beispiel #2
0
 def _factory(device_id,
              event_type="DEVICE_EVENT",
              capability='',
              attribute='Updated',
              value='Value',
              data=None):
     event = Mock()
     event.event_type = event_type
     event.device_id = device_id
     event.component_id = 'main'
     event.capability = capability
     event.attribute = attribute
     event.value = value
     event.data = data
     event.location_id = str(uuid4())
     return event
Beispiel #3
0
 def _factory(
     device_id,
     event_type="DEVICE_EVENT",
     capability="",
     attribute="Updated",
     value="Value",
     data=None,
 ):
     event = Mock()
     event.event_type = event_type
     event.device_id = device_id
     event.component_id = "main"
     event.capability = capability
     event.attribute = attribute
     event.value = value
     event.data = data
     event.location_id = str(uuid4())
     return event