text: const FanDevice = require('../FanDevice.js');
  const FanProperties = require('../FanProperties.js');
  const Actions = require('../../../constants/Actions.js');
  const Constants = require('../../../constants/Constants.js');
  const PropFormat = require('../../../constants/PropFormat.js');
  const PropUnit = require('../../../constants/PropUnit.js');
  const PropAccess = require('../../../constants/PropAccess.js');
  
  // Spec:
  // https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:fan:0000A005:dmaker-1c:1
  
  
  class DmakerFan1C extends FanDevice {
    constructor(miioDevice, model, deviceId, name, logger) {
      super(miioDevice, model, deviceId, name, logger);
    }
  
  
    /*----------========== INIT ==========----------*/
  
    initDeviceProperties() {
      // READ/WRITE
      this.addProperty(FanProperties.POWER, 2, 1, PropFormat.BOOL, PropAccess.READ_WRITE_NOTIFY, PropUnit.NONE);
      this.addProperty(FanProperties.FAN_LEVEL, 2, 2, PropFormat.UINT8, PropAccess.READ_WRITE_NOTIFY, PropUnit.NONE, [], [{
          "value": 1,
          "description": "Level1"
        },
        {
          "value": 2,
          "description": "Level2"
        },
        {
          "value": 3,
          "description": "Level3"
        }
      ]);
      this.addProperty(FanProperties.HORIZONTAL_SWING, 2, 3, PropFormat.BOOL, PropAccess.READ_WRITE_NOTIFY, PropUnit.NONE);
      this.addProperty(FanProperties.MODE, 2, 7, PropFormat.UINT8, PropAccess.READ_WRITE_NOTIFY, PropUnit.NONE, [], [{
          "value": 0,
          "description": "Straight Wind"
        },
        {
          "value": 1,
          "description": "Sleep"
        }
      ]);
      this.addProperty(FanProperties.POWER_OFF_TIME, 2, 10, PropFormat.UINT16, PropAccess.READ_WRITE_NOTIFY, PropUnit.MINUTES, [0, 480, 1]);
      this.addProperty(FanProperties.ALARM, 2, 11, PropFormat.BOOL, PropAccess.READ_WRITE_NOTIFY, PropUnit.NONE);
      this.addProperty(FanProperties.LED, 2, 12, PropFormat.BOOL, PropAccess.READ_WRITE_NOTIFY, PropUnit.NONE);
      this.addProperty(FanProperties.CHILD_LOCK, 3, 1, PropFormat.BOOL, PropAccess.READ_WRITE_NOTIFY, PropUnit.NONE);
    }
  
    initDeviceActions() {
      this.addAction(Actions.TOGGLE, 2, 1, []);
    }
  
  
    /*----------========== CONFIG ==========----------*/
  
    straightWindModeValue() {
      return 0;
    }
  
    sleepModeValue() {
      return 1;
    }
  
    emulateSteplessFanSpeed() {
      return true;
    }
  
  
  }
  
  module.exports = DmakerFan1C;
  