1
0

HydrawiseZone.d.ts 2.1 KB

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