IoTReady / aws_iot_demo

Line too long FLK-E501
Style
Minor
6 occurrences in this check
line too long (99 > 88 characters)
59
60
61if __name__ == "__main__":
62    parser = argparse.ArgumentParser(description='Continuously monitor and report system metrics.')63    parser.add_argument('interval', metavar='INTERVAL', type=int,
64                        help='reporting interval in seconds')
65    parser.add_argument('device_id', metavar='DEVICE_ID',
line too long (98 > 88 characters)
 9
10def get_aws_iot_certs(device_id):
11    certs_dir = os.getenv('CERTS_DIR')
12    root_ca_cert = os.path.join(certs_dir, "AmazonRootCA1.pem") # Adjust per your Root CA settings13    device_cert = os.path.join(certs_dir, "{}-certificate.pem.crt".format(device_id))
14    device_private_key = os.path.join(certs_dir, "{}-private.pem.key".format(device_id))
15    assert os.path.exists(root_ca_cert), "Root CA Certificate not found"
line too long (95 > 88 characters)
79    myAWSIoTMQTTShadowClient.connect()
80
81    # Create a deviceShadow with persistent subscription
82    deviceShadowHandler = myAWSIoTMQTTShadowClient.createShadowHandlerWithName(thingName, True)83
84    # Delete existing shadow JSON doc
85    deviceShadowHandler.shadowDelete(shadow_delete_callback, 5)
line too long (95 > 88 characters)
46        clientId = thingName
47
48    if useWebsocket and certificatePath and privateKeyPath:
49        print("X.509 cert authentication and WebSocket are mutual exclusive. Please pick one.")50        exit(2)
51
52    if not useWebsocket and (not certificatePath or not privateKeyPath):
line too long (97 > 88 characters)
56    # Port defaults
57    if useWebsocket and not port:  # When no port override for WebSocket, default to 443
58        port = 443
59    if not useWebsocket and not port:  # When no port override for non-WebSocket, default to 888360        port = 8883
61
62    # Init AWSIoTMQTTShadowClient
line too long (98 > 88 characters)
68    else:
69        myAWSIoTMQTTShadowClient = AWSIoTMQTTShadowClient(clientId)
70        myAWSIoTMQTTShadowClient.configureEndpoint(host, port)
71        myAWSIoTMQTTShadowClient.configureCredentials(rootCAPath, privateKeyPath, certificatePath)72
73    # AWSIoTMQTTShadowClient configuration
74    myAWSIoTMQTTShadowClient.configureAutoReconnectBackoffTime(1, 32, 20)