HydrawiseZone.d.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * @author Martijn Dierckx
  3. */
  4. import { Hydrawise } from "./Hydrawise";
  5. import { HydrawiseController } from "./HydrawiseController";
  6. /** Class representing a Hydrawise zone */
  7. export declare class HydrawiseZone {
  8. apiBinding: Hydrawise;
  9. relayID: number;
  10. zone: number;
  11. name: string;
  12. nextRunAt: Date;
  13. nextRunDuration: number;
  14. isSuspended: boolean;
  15. isRunning: boolean;
  16. remainingRunTime: number;
  17. controller: HydrawiseController;
  18. /**
  19. * Create a new instance of a HydrawiseZone
  20. * @param {object} options - Options object containing all parameters
  21. * @param {Hydrawise} options.apiBinding - The API binding which can be used to execute commands on the zone
  22. * @param {number} options.relayID - The unique relay number known to the Hydrawise cloud
  23. * @param {number} options.zone - The local zone/relay number
  24. * @param {string} options.name - The name of the zone
  25. * @param {Date} options.nextRunAt - The date & time of the next scheduled run
  26. * @param {number} options.nextRunDuration - Run time in seconds of the next run defined by nextRunAt
  27. * @param {boolean} options.isSuspended - Returns true when the zoneis currently suspended
  28. * @param {boolean} options.isRunning - Returns true when the zone is actively running
  29. * @param {number} options.remainingRunTime - Remaining run time in seconds when isRunning = true
  30. * @param {HydrawiseController} [options.controller] - The controller linked to the zone
  31. */
  32. constructor(options: any);
  33. /**
  34. * Sends the run command to the zone/relay
  35. * @param {number} [duration] - How long should the command be executed
  36. * @return {Promise} A Promise which will be resolved when the command has been executed.
  37. */
  38. run(duration?: number): Promise<any>;
  39. /**
  40. * Sends the stop command to the zone/relay
  41. * @return {Promise} A Promise which will be resolved when the command has been executed.
  42. */
  43. stop(): Promise<any>;
  44. /**
  45. * Sends the suspend command to the zone/relay
  46. * @param {number} [duration] - How long should the command be executed
  47. * @return {Promise} A Promise which will be resolved when the command has been executed.
  48. */
  49. suspend(duration?: number): Promise<any>;
  50. }
  51. //# sourceMappingURL=HydrawiseZone.d.ts.map