Skip to content

Sensors with duplicate labels are dropped #49

@anssih

Description

@anssih

The code uses the following to process the sensors from the glances API:

        sensor_data["sensors"] = {}
        for sensor in data:
            sensor_data["sensors"][sensor["label"]] = {
                sensor["type"]: sensor["value"]
            }

However, some sensors have identical labels, e.g. on my system there is both a Chipset fan speed and a Chipset temperature:

  {
     "critical" : null,
     "key" : "label",
     "label" : "Chipset",
     "type" : "temperature_core",
     "unit" : "C",
     "value" : 78,
     "warning" : null
  },

  {
     "critical" : null,
     "key" : "label",
     "label" : "Chipset",
     "type" : "fan_speed",
     "unit" : "R",
     "value" : 4487,
     "warning" : null
  }

The first one is dropped, so HA will not see the chipset temperature sensor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions