#ecoforest

1 messages ยท Page 1 of 1 (latest)

chrome needle
#

Let's start a thread

#

nice job btw

#

๐Ÿ™‚

paper cape
#

thanks for your ncie reviews @chrome needle ๐Ÿ‘

chrome needle
#

I mean, the PRs are small and easy to check etc

paper cape
#

the language and codebase is new to me but been doing this for a while already ๐Ÿ˜„

#

but is always good to know

chrome needle
#

But yea, throw your approach and let's see if I can help

paper cape
#

need to leave for a few moments, i will describe when i get back

chrome needle
#

sure, no hurry

paper cape
#

the fireplace have two modes: power and temperature, the user can switch between them
what would be the common way of handling this?
for example when device registered it will create the appropriate entities for the mode that is enabled or it should create all entities to both modes?

#

th euser can change this mode at any given time

chrome needle
#

I think both should be enabled

#

Oh wait, got distracted in the meantime

#

Euh, yea, have a select entity to switch between the two modes

#

I mean it probably already works like that in the app currently

paper cape
#

the select i was expecting

#

just not sure about the entities it self

chrome needle
#

I mean as long as we document it well it's fine

paper cape
#

the website renders different info base on the mode

chrome needle
#

ah right

paper cape
#

can we disable entities based on that switch selection?

#

disable/hide

#

?

chrome needle
#

Technically you can, but we don't do that

#

I mean, if it's in power level mode and you update the temperature and the device is just doing it

#

Why not

#

if it becomes something that could break the device, we should raise an error of some sort

paper cape
#

it is awkward

#

but regarding temp yes

#

it doesnt do anything

#

but in the device "ui" it will show everything when doesnt make much sense i guess

#

but if that is pattern ok

#

another this is how is errors handled for example if a user does one action and the api/sdk doesnt allow is there any error dialog or something

#

what is a common way of handling those?

chrome needle
#

raising HomeAssistantError

#

But I think you should also imagine, people don't usually change settings if it doesnt do anything

paper cape
#

there might be undesired behaviours when turning on and off due to the state of the state machine

#

the device state machine is not just on and off

#

you turn on and go to several states until is on state on

#

you turn off and goes to several states until is off

#

for now i will leave as it is, but i seen some weird behaviour in the past while using the rest sensors and manipulating directly , i want to understand them better before put anything in the sdk

#

๐Ÿ‘

chrome needle
#

Also depending how quick the device responds

paper cape
#

yes it is in the library

#

but also if the library raise errors need to understand how to do the bridge

chrome needle
#

Did I answer your question or are you still in doubt

paper cape
#

i think fo r the upcoming times i will add the following:

  1. temperature target number
  2. set temp number or power number to disable (config flow) if operation mode in temp or power, i believe is not common to switch between modes but if the user switch it can enable the appropriate sensors
#

this way we support both operation modes and keep it straight to the user

#

any thoughts?

#

regarding the errors i will digg later

chrome needle
#

Euh

#

Not sure what you mean, but I would say keep all entities available at all time

paper cape
#

i meant that when the user add the integration only the current mode entities woould be enable the others would be disabled