Class: EmuPower::Commands::SetSchedule
- Defined in:
- lib/emu_power/commands.rb
Overview
Note: This doesn’t seem to work. The command is issued successfully, but the EMU does not update any schedule info. This may be disallowed by the meter or something.
Constant Summary collapse
- EVENTS =
%w[time message price summation demand scheduled_prices profile_data billing_period block_period]
Instance Method Summary collapse
-
#initialize(event, frequency, enabled) ⇒ SetSchedule
constructor
A new instance of SetSchedule.
Methods inherited from Command
Constructor Details
#initialize(event, frequency, enabled) ⇒ SetSchedule
Returns a new instance of SetSchedule.
82 83 84 85 86 87 88 |
# File 'lib/emu_power/commands.rb', line 82 def initialize(event, frequency, enabled) super('set_schedule') raise ArgumentError.new("Event must be one of #{EVENTS.join(', ')}") unless EVENTS.include?(event) @data[:event] = event @data[:frequency] = to_hex(frequency, 4) @data[:enabled] = to_yn(enabled) end |