Skip to content

Commit

Permalink
Refine T21 example
Browse files Browse the repository at this point in the history
  • Loading branch information
ejohb committed Jan 18, 2023
1 parent 9d9caaa commit d326a00
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions examples/proscenic_t21.be
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ hct.Number(
nil,
'minutes',
nil,
'mdi:timer',
'mdi:timer-sync',
{
/v->v:'tuyareceived#DpType2Id105',
/v->5:'power3#state'
Expand Down Expand Up @@ -109,6 +109,17 @@ hct.Number(
end
)

# Mode/status sensor. Note: This does not seem to exist on all versions.
hct.Sensor(
'Air Fryer Mode',
nil,
'mdi:chef-hat',
{
/value->{0:'Ready',1:'Delayed Cook',2:'Cooking',3:'Keep Warm',4:'Off',5:'Cooking Complete'}.find(value,'Unknown'):
'tuyareceived#dptype4id5'
}
)

# Lastly we add the cookbook pull-down. This has already been covered in the README: https://github.com/fmtr/hct#example-walkthrough

hct.Select(
Expand All @@ -120,14 +131,5 @@ hct.Select(
/value->tasmota.cmd('TuyaEnum1 '+str(value))
)

# Mode/status sensor. Note: This does not seem to exist on all versions.
hct.Sensor(
'Air Fryer Mode',
nil,
'mdi:chef-hat',
{
/value->{0:'Ready',1:'Delayed Cook',2:'Cooking',3:'Keep Warm',4:'Off',5:'Cooking Complete'].find(value,'Unknown'):
'tuyareceived#dptype4id5'
}
)


0 comments on commit d326a00

Please sign in to comment.