import { Component, ChangeDetectionStrategy } from "@angular/core";

import { AbstractFlatWidget } from "src/app/shared/components/flat/abstract-flat-widget";
import { ChannelAddress } from "src/app/shared/shared";

@Component({
    selector: "enerixControlWidget",
    templateUrl: "./flat.html",
    changeDetection: ChangeDetectionStrategy.Eager,
    standalone: false,
})
export class FlatComponent extends AbstractFlatWidget {
    protected TIME_CONVERTER = this.Converter.FORMAT_SECONDS_TO_DURATION("de");

    protected override getChannelAddresses(): ChannelAddress[] {
        if (this.component == null) {
            return [];
        }

        return [
            new ChannelAddress(this.component.id, "CumulatedInactiveTime"),
            new ChannelAddress(this.component.id, "CumulatedNoDischargeTime"),
            new ChannelAddress(this.component.id, "CumulatedChargeFromGridTime"),
        ];
    }
}
