def test_devices_pagination(): set_access_token(USER_EMAIL, USER_PASSWORD) devices, _ = get_devices(10, 1) assert devices is not None devices, _ = get_devices(10, 20) assert not devices
def test_adoption_by_list_and_detach(): set_access_token(USER_EMAIL, USER_PASSWORD) devices, _ = get_devices() for device in devices: delete_device_by_id(device["id"]) devices, error = adopt_by_device_list(['000000789210300053', '000000789210300054']) print(error) assert devices["results"] devices, _ = get_devices() for device in devices: delete_device_by_id(device["id"])
def test_find_devices(): set_access_token(USER_EMAIL, USER_PASSWORD) devices, _ = get_devices() assert devices is not None assert len(devices) for device in devices: print(device)
def test_get_data_events(): set_access_token(USER_EMAIL, USER_PASSWORD) devices, _ = get_devices() assert devices is not None device_id = devices[0]["id"] result, _ = get_measures_data(device_id, '32', '2021-07-10T10:33:19.196Z') print(result) assert result == []
def test_get_lock_status(): set_access_token(USER_EMAIL, USER_PASSWORD) devices, _ = get_devices() assert devices is not None device_id = devices[0]["id"] status, _ = get_lock_status_by_device(device_id) print(status) assert status is not None
def test_find_commands_by_device_id(): set_access_token(USER_EMAIL, USER_PASSWORD) devices, _ = get_devices() assert devices is not None device_id = devices[0]["id"] commands, _ = find_commands_by_device_id(device_id) assert commands is not None assert len(commands) > 0
def test_commands_pagination(): set_access_token(USER_EMAIL, USER_PASSWORD) devices, _ = get_devices() assert devices is not None device_id = devices[0]["id"] commands, _ = find_commands_by_device_id(device_id, 10, 1) assert commands is not None commands, _ = find_commands_by_device_id(device_id, 100, 20) assert not commands
def test_create_command_by_device_id(): set_access_token(USER_EMAIL, USER_PASSWORD) devices, _ = get_devices() assert devices is not None device_id = devices[0]["id"] command, _ = send_command_by_device_id( device_id, name='Estado de Cerradura', package='a013a17efe9e7a3f69ec4a4a53b749cd7a60b1' ) assert command is not None assert command['code'] == 200 assert command['sent'] assert command['message'] == 'Command sent' print(command)