//
// © 2018-2020 Qualcomm Technologies, Inc. and/or its subsidiaries. All rights reserved.
//

import UIKit

class ZigbeeDisplayableWrapper: NSObject, MasterViewControllerDisplayable, MasterViewControllerDisplayablePlayerChild {
    weak var parent: MasterViewControllerDisplayable?
    var name: String
    let children = [MasterViewControllerDisplayable] ()
    let depth: UInt
    let zbDeviceID: UInt
    let zbDeviceType: IoTZigbeeDeviceType
    let playerID: String
    var available: Bool

    init(name: String,
         zbDeviceID: UInt,
         zbDeviceType: IoTZigbeeDeviceType,
         playerID: String,
         depth: UInt,
         available: Bool) {
        self.name = name
        self.depth = depth
        self.zbDeviceID = zbDeviceID
        self.zbDeviceType = zbDeviceType
        self.playerID = playerID
        self.available = available
    }

    var id: String {
        return "ZB:" + playerID + "-" + String(zbDeviceID)
    }

    var stateDescription: [String] {
        return []
    }

    var encapsulatedType: MasterViewControllerDisplayableType {
        switch zbDeviceType {
        case .light:
            return .zigbeeLight
        case .thermostat:
            return .zigbeeThermostat
        default:
            return .zigbeeOther
        }
    }
}
