constructor(options) {
        super(Object.assign(options, {
            friendlyName: "Total Statistics",
            helpMayChange: {
                "Properties": "Available statistics depend on the robot model.",
            }
        }));
        this.capability = options.capability;

        this.capability.getProperties().availableStatistics.forEach(availableStatistic => {
            switch (availableStatistic) {
                case ValetudoDataPoint.TYPES.TIME:
                    this.registerChild(
                        new PropertyMqttHandle({
                            parent: this,
                            controller: this.controller,
                            topicName: "time",
                            friendlyName: "Total Statistics Time",
                            datatype: DataType.INTEGER,
                            unit: Unit.SECONDS,
                            getter: async () => {
                                return this.controller.hassAnchorProvider.getAnchor(
                                    HassAnchor.ANCHOR.TOTAL_STATISTICS_TIME
                                ).getValue();
                            },
                            helpText: "This handle returns the total statistics time in seconds"
                        }).also((prop) => {
                            this.controller.withHass((hass => {
                                prop.attachHomeAssistantComponent(
                                    new InLineHassComponent({
                                        hass: hass,
                                        robot: this.robot,
                                        name: this.capability.getType() + "_time",
                                        friendlyName: "Total Statistics Time",
                                        componentType: ComponentType.SENSOR,
                                        autoconf: {
                                            state_topic: prop.getBaseTopic(),
                                            icon: "mdi:equalizer",
                                            entity_category: EntityCategory.DIAGNOSTIC,
                                            unit_of_measurement: Unit.SECONDS
                                        }
                                    })
                                );
                            }));
                        })
                    );
                    break;

                case ValetudoDataPoint.TYPES.AREA:
                    this.registerChild(
                        new PropertyMqttHandle({
                            parent: this,
                            controller: this.controller,
                            topicName: "area",
                            friendlyName: "Total Statistics Area",
                            datatype: DataType.INTEGER,
                            unit: Unit.SQUARE_CENTIMETER,
                            getter: async () => {
                                return this.controller.hassAnchorProvider.getAnchor(
                                    HassAnchor.ANCHOR.TOTAL_STATISTICS_AREA
                                ).getValue();
                            }
                        }).also((prop) => {
                            this.controller.withHass((hass => {
                                prop.attachHomeAssistantComponent(
                                    new InLineHassComponent({
                                        hass: hass,
                                        robot: this.robot,
                                        name: this.capability.getType() + "_area",
                                        friendlyName: "Total Statistics Area",
                                        componentType: ComponentType.SENSOR,
                                        autoconf: {
                                            state_topic: prop.getBaseTopic(),
                                            icon: "mdi:equalizer",
                                            entity_category: EntityCategory.DIAGNOSTIC,
                                            unit_of_measurement: Unit.SQUARE_CENTIMETER
                                        }
                                    })
                                );
                            }));
                        })
                    );
                    break;
                case ValetudoDataPoint.TYPES.COUNT:
                    this.registerChild(
                        new PropertyMqttHandle({
                            parent: this,
                            controller: this.controller,
                            topicName: "count",
                            friendlyName: "Total Statistics Count",
                            datatype: DataType.INTEGER,
                            unit: Unit.AMOUNT,
                            getter: async () => {
                                return this.controller.hassAnchorProvider.getAnchor(
                                    HassAnchor.ANCHOR.TOTAL_STATISTICS_COUNT
                                ).getValue();
                            }
                        }).also((prop) => {
                            this.controller.withHass((hass => {
                                prop.attachHomeAssistantComponent(
                                    new InLineHassComponent({
                                        hass: hass,
                                        robot: this.robot,
                                        name: this.capability.getType() + "_count",
                                        friendlyName: "Total Statistics Count",
                                        componentType: ComponentType.SENSOR,
                                        autoconf: {
                                            state_topic: prop.getBaseTopic(),
                                            icon: "mdi:equalizer",
                                            entity_category: EntityCategory.DIAGNOSTIC
                                        }
                                    })
                                );
                            }));
                        })
                    );
                    break;
            }
        });
    }
@param {object} options
@param {import("../handles/RobotMqttHandle")} options.parent
@param {import("../MqttController")} options.controller MqttController instance
@param {import("../../core/ValetudoRobot")} options.robot
@param {import("../../core/capabilities/TotalStatisticsCapability")} options.capability