53 lines
1.1 KiB
Swift
Generated
53 lines
1.1 KiB
Swift
Generated
///
|
|
/// ThermalState.swift
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © Marc Rousavy @ Margelo
|
|
///
|
|
|
|
/**
|
|
* Represents the JS union `ThermalState`, backed by a C++ enum.
|
|
*/
|
|
public typealias ThermalState = margelo.nitro.haptika.ppg.ThermalState
|
|
|
|
public extension ThermalState {
|
|
/**
|
|
* Get a ThermalState for the given String value, or
|
|
* return `nil` if the given value was invalid/unknown.
|
|
*/
|
|
init?(fromString string: String) {
|
|
switch string {
|
|
case "nominal":
|
|
self = .nominal
|
|
case "fair":
|
|
self = .fair
|
|
case "serious":
|
|
self = .serious
|
|
case "critical":
|
|
self = .critical
|
|
case "unknown":
|
|
self = .unknown
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Get the String value this ThermalState represents.
|
|
*/
|
|
var stringValue: String {
|
|
switch self {
|
|
case .nominal:
|
|
return "nominal"
|
|
case .fair:
|
|
return "fair"
|
|
case .serious:
|
|
return "serious"
|
|
case .critical:
|
|
return "critical"
|
|
case .unknown:
|
|
return "unknown"
|
|
}
|
|
}
|
|
}
|