summaryrefslogtreecommitdiff
path: root/watchos/InfiniSolar/InfiniSolar WatchKit Extension/InverterStatus.swift
blob: cd31eeabefec3d7656c18d781b958509c507120b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//
//  InverterStatus.swift
//  InfiniSolar WatchKit Extension
//
//  Created by Evgeny Zinoviev on 03.08.2021.
//

import Foundation

struct InverterStatus: Hashable {
    public var batteryVoltage: Float
    public var batteryCapacity: Int
    public var activePower: Int
    public var pvInputPower: Int
    
    init(batteryVoltage: Float, batteryCapacity: Int, activePower: Int, pvInputPower: Int) {
        self.batteryVoltage = batteryVoltage
        self.batteryCapacity = batteryCapacity
        self.activePower = activePower
        self.pvInputPower = pvInputPower
    }
    
    func hasData() -> Bool {
        return self.batteryVoltage != 0
            || self.batteryCapacity != 0
            || self.activePower != 0
            || self.pvInputPower != 0
    }
}