tschroedter / idasen-desk-rest-api

MIT License
0 stars 0 forks source link

Fix MaxHeight const #5

Closed 7orlum closed 1 year ago

7orlum commented 2 years ago

There is too strong height restrictions in HeightDtoValidator class: private const uint MinHeight = 6000u ; private const uint MaxHeight = 12000u ;

All my tables have different min and max height. One of them has max height equal to 12700, but the program does not allow you to raise the table to the maximum level because of the MaxHeight restriction above.

tschroedter commented 2 years ago

I changed the max height to 12700u as a quick fix. I think I can move the min/max height into the appsettings.json or SettingsDto later.

7orlum commented 2 years ago

Maybe a positive number check would be enough? Now it looks like an excessive checking for me. Anyway the desk will ignore incorrect height by itself, so the simplest way is not to check an input height.

7orlum commented 2 years ago

I wrote "my desks have different min and max height" but I've rechecked it again. My desks were produced in 2021 and they all have the same MinHeight = 6200 and MaxHeight = 12700. Do you really have different values in your desk? Did you try to calibrate the desk?

tschroedter commented 2 years ago

I've check my desk is also limited to 6200-12700. So, I'll use these values as hard limits. I know the desk is smart not to move the desk outside these limits. But it still make sense to limit it in code as a safety feature.

PS: I didn't try to calibrate the desk. But I thought if I want to put a drawer under the desk which is higher then 6200 then it would be nice to set the min. height >6200.