Skip to content

Commit aa2c38b

Browse files
committed
Do not send extension data.
1 parent d4639ae commit aa2c38b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

myDevices/sensors/sensors.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ def SensorsInfo(self):
164164
'DigitalActuator': {'function': 'read', 'data_args': {'type': 'digital_actuator', 'unit': 'd'}},
165165
'AnalogSensor': {'function': 'readFloat', 'data_args': {'type': 'analog_sensor'}},
166166
'AnalogActuator': {'function': 'readFloat', 'data_args': {'type': 'analog_actuator'}}}
167-
extension_types = {'ADC': {'function': 'analogReadAllFloat'},
168-
'DAC': {'function': 'analogReadAllFloat'},
169-
'PWM': {'function': 'pwmWildcard'},
170-
'GPIOPort': {'function': 'wildcard'}}
167+
# extension_types = {'ADC': {'function': 'analogReadAllFloat'},
168+
# 'DAC': {'function': 'analogReadAllFloat'},
169+
# 'PWM': {'function': 'pwmWildcard'},
170+
# 'GPIOPort': {'function': 'wildcard'}}
171171
for device_type in device['type']:
172172
try:
173173
display_name = device['description']
@@ -184,16 +184,16 @@ def SensorsInfo(self):
184184
cayennemqtt.DataChannel.add(sensors_info, cayennemqtt.DEV_SENSOR, channel, value=self.CallDeviceFunction(func), name=display_name, **sensor_type['data_args'])
185185
except:
186186
exception('Failed to get sensor data: {} {}'.format(device_type, device['name']))
187-
else:
188-
try:
189-
extension_type = extension_types[device_type]
190-
func = getattr(sensor, extension_type['function'])
191-
values = self.CallDeviceFunction(func)
192-
for pin, value in values.items():
193-
cayennemqtt.DataChannel.add(sensors_info, cayennemqtt.DEV_SENSOR, device['name'] + ':' + str(pin), cayennemqtt.VALUE, value, name=display_name)
194-
except:
195-
exception('Failed to get extension data: {} {}'.format(device_type, device['name']))
196-
logJson('Sensors info: {}'.format(sensors_info))
187+
# else:
188+
# try:
189+
# extension_type = extension_types[device_type]
190+
# func = getattr(sensor, extension_type['function'])
191+
# values = self.CallDeviceFunction(func)
192+
# for pin, value in values.items():
193+
# cayennemqtt.DataChannel.add(sensors_info, cayennemqtt.DEV_SENSOR, device['name'] + ':' + str(pin), cayennemqtt.VALUE, value, name=display_name)
194+
# except:
195+
# exception('Failed to get extension data: {} {}'.format(device_type, device['name']))
196+
info('Sensors info: {}'.format(sensors_info))
197197
return sensors_info
198198

199199
def AddSensor(self, name, description, device, args):

0 commit comments

Comments
 (0)