def setup_platform(hass, config, add_entities, discovery_info=None):
Setup the APCUPSd sensor.
typ = config.get(apcupsd.CONF_TYPE)
if typ is None:
_LOGGER.error(
"You must include a "%s" when configuring an APCUPSd sensor.",
apcupsd.CONF_TYPE)
After Change
entities = []
for resource in config["resources"]:
sensor_type = resource.lower()
if sensor_type not in SENSOR_TYPES:
SENSOR_TYPES[sensor_type] = [
sensor_type.title(), "", "mdi:information-outline"]