Closed ReagentX closed 2 years ago
>>> cse = Sensor(6643) Child sensor requested, acquiring parent instead. >>> cse.identifier 6643
The identifier should be the parent’s ID (6642), because cse is filled with the data from 6642:
6642
cse
https://github.com/ReagentX/purple_air_api/blob/bac87dfc1c0005e37ac60d7f0552f346ee4cddaf/purpleair/sensor.py#L66-L69
However, the library naively assigns the identifier from the Sensor.__init__() construction call, regardless of what data it gets filled with.
Sensor.__init__()
https://github.com/ReagentX/purple_air_api/blob/bac87dfc1c0005e37ac60d7f0552f346ee4cddaf/purpleair/sensor.py#L25
The identifier should be the parent’s ID (
6642
), becausecse
is filled with the data from6642
:https://github.com/ReagentX/purple_air_api/blob/bac87dfc1c0005e37ac60d7f0552f346ee4cddaf/purpleair/sensor.py#L66-L69
However, the library naively assigns the identifier from the
Sensor.__init__()
construction call, regardless of what data it gets filled with.https://github.com/ReagentX/purple_air_api/blob/bac87dfc1c0005e37ac60d7f0552f346ee4cddaf/purpleair/sensor.py#L25