|
@@ -590,32 +590,18 @@ class deviceStatus(TemplateView):
|
|
}
|
|
}
|
|
]
|
|
]
|
|
if online is not None:
|
|
if online is not None:
|
|
- if online == '1':
|
|
|
|
- endpoint_health_value = 'OK'
|
|
|
|
- properties.append(
|
|
|
|
- {
|
|
|
|
- "namespace": "Alexa.EndpointHealth",
|
|
|
|
- "name": "connectivity",
|
|
|
|
- "value": {
|
|
|
|
- "value": endpoint_health_value
|
|
|
|
- },
|
|
|
|
- "timeOfSample": time_of_sample,
|
|
|
|
- "uncertaintyInMilliseconds": 0
|
|
|
|
- }
|
|
|
|
- )
|
|
|
|
- else:
|
|
|
|
- endpoint_health_value = 'UNREACHABLE'
|
|
|
|
- properties = [
|
|
|
|
- {
|
|
|
|
- "namespace": "Alexa.EndpointHealth",
|
|
|
|
- "name": "connectivity",
|
|
|
|
- "value": {
|
|
|
|
- "value": endpoint_health_value
|
|
|
|
- },
|
|
|
|
- "timeOfSample": time_of_sample,
|
|
|
|
- "uncertaintyInMilliseconds": 0
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
|
|
+ endpoint_health_value = 'OK' if online == '1' else 'UNREACHABLE'
|
|
|
|
+ properties.append(
|
|
|
|
+ {
|
|
|
|
+ "namespace": "Alexa.EndpointHealth",
|
|
|
|
+ "name": "connectivity",
|
|
|
|
+ "value": {
|
|
|
|
+ "value": endpoint_health_value
|
|
|
|
+ },
|
|
|
|
+ "timeOfSample": time_of_sample,
|
|
|
|
+ "uncertaintyInMilliseconds": 0
|
|
|
|
+ }
|
|
|
|
+ )
|
|
logger.info('插座ChangeReport properties:{}'.format(properties))
|
|
logger.info('插座ChangeReport properties:{}'.format(properties))
|
|
payload = {
|
|
payload = {
|
|
"event": {
|
|
"event": {
|