Class: ESPHome::Entities::DateTime
Instance Attribute Summary
#device, #disabled_by_default, #entity_category, #icon, #key, #name, #object_id_
Instance Method Summary
collapse
#inspect
Instance Method Details
#command(state) ⇒ Object
16
17
18
|
# File 'lib/esphome/entities/date_time.rb', line 16
def command(state)
device.send(Api::DateTimeCommandRequest.new(key:, epoch_seconds: state.to_i))
end
|
#update(state_response) ⇒ Object
8
9
10
11
12
13
14
|
# File 'lib/esphome/entities/date_time.rb', line 8
def update(state_response)
@state = if state_response.missing_state
nil
else
::Time.at(state_response.epoch_seconds)
end
end
|