comparison eprodbus.py @ 20:8d48ca5294d3

Use add_mandatory_paths rather than rolling our own.
author Daniel O'Connor <darius@dons.net.au>
date Thu, 09 Dec 2021 11:48:48 +1030
parents 3a3dba401b4a
children 625064987b7c
comparison
equal deleted inserted replaced
19:3a3dba401b4a 20:8d48ca5294d3
165 signal.signal(signal.SIGINT, doexit) 165 signal.signal(signal.SIGINT, doexit)
166 166
167 DBusGMainLoop(set_as_default = True) 167 DBusGMainLoop(set_as_default = True)
168 168
169 dbusservice = VeDbusService(servicename) 169 dbusservice = VeDbusService(servicename)
170 dbusservice.add_path('/Connected', value = True) 170 dbusservice.add_mandatory_paths(__file__, '1.0', 'Serial ' + port, instance, 0, 'Enerdrive ePro', '1.0', '1.0', 1)
171 dbusservice.add_path('/ProductName', value = 'Enerdrive ePro')
172 dbusservice.add_path('/Mgmt/Connection', value = '/dev/' + port)
173 dbusservice.add_path('/DeviceInstance', value = instance)
174 dbusservice.add_path('/ProductId', value = 'unknown')
175 dbusservice.add_path('/Dc/0/Voltage', value = None) 171 dbusservice.add_path('/Dc/0/Voltage', value = None)
176 dbusservice.add_path('/Dc/0/Temperature', value = None) 172 dbusservice.add_path('/Dc/0/Temperature', value = None)
177 dbusservice.add_path('/Dc/0/Current', value = None) 173 dbusservice.add_path('/Dc/0/Current', value = None)
178 dbusservice.add_path('/Dc/1/Voltage', value = None) 174 dbusservice.add_path('/Dc/1/Voltage', value = None)
179 dbusservice.add_path('/Soc', value = None) 175 dbusservice.add_path('/Soc', value = None)