Skip to content

Commit

Permalink
fix: "Enum not found" (#9)
Browse files Browse the repository at this point in the history
* Add refrigerator support

* Add method getDevice

* Add dishwasher

* Refactoring

* Add dryer

* Add washer

* Fixed import paths in devices/ac

* Fix Celsius to Fahrenheit convertion table

* Fixed swing mode so they are mapped to the right enum.

* Add the ACDevice to the client loader

* Small fix

* Update ac.ts

* Update client.ts

* All parameters to lowercase

* Add multi language support

* Fix for comments

* Add localization support

* Update README.md

* Add tslint

* Refactoring

* Some fixes for tslint

* Add devices to export

* Fix "[DEP0091] DeprecationWarning: crypto.DEFAULT_ENCODING is deprecated." (nodejs/node#23203)

* Add more options for RefrigeratorDevice

* Small fix for washer

* Add parameter --token into cli

* Add method setOn

* Add OnOffEnum

* Update README.md

* Fix for lookupReference
Add more device types

* Fix for lookupEnum

Co-authored-by: Tom Green <[email protected]>
  • Loading branch information
aklimov-work and squareplanetdesign committed Mar 4, 2020
1 parent e245355 commit 204d823
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export function asTime(hoursKey: string, minutesKey: string, data: any) {
* @returns The enum value.
*/
export function lookupEnum(attr: string, data: any, device: Device) {
if (!(attr in data)) {
return null;
}
return device.model.enumName(attr, data[attr]);
}

Expand Down

0 comments on commit 204d823

Please sign in to comment.