#ecoforest
1 messages ยท Page 1 of 1 (latest)
thanks for your ncie reviews @chrome needle ๐
I mean, the PRs are small and easy to check etc
the language and codebase is new to me but been doing this for a while already ๐
but is always good to know
But yea, throw your approach and let's see if I can help
need to leave for a few moments, i will describe when i get back
sure, no hurry
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
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
I mean as long as we document it well it's fine
the website renders different info base on the mode
ah right
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
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?
raising HomeAssistantError
But I think you should also imagine, people don't usually change settings if it doesnt do anything
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
๐
I think the library is the place for those things
Also depending how quick the device responds
yes it is in the library
but also if the library raise errors need to understand how to do the bridge
Did I answer your question or are you still in doubt
i think fo r the upcoming times i will add the following:
- temperature target number
- 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
Euh
Not sure what you mean, but I would say keep all entities available at all time
i meant that when the user add the integration only the current mode entities woould be enable the others would be disabled