gfroerli / api

Coredump Gfrörli Water Temperature Sensor API
https://watertemp-api.coredump.ch/
GNU Affero General Public License v3.0
3 stars 0 forks source link

Add abbreviation for sensor names #185

Open Makram95 opened 4 months ago

Makram95 commented 4 months ago

I have some places in my app where all of the current sensor names are much too long. Ideally we can add a name abbreviation field to the Sensor type, with a max String length of 3 or 4. See the "DOH" as an example.

incoming-D5968DE1-D720-411B-8EE7-8ABF9E7D3FB4

dbrgn commented 4 months ago

I'd suggest adding a "shortname" field to the sensors table. Length could be limited to 4 characters.

rnestler commented 4 months ago

Do we want to define the shortname for every user? Wouldn't it be better if they can define the shortname themselves per sensor in the App?

Makram95 commented 4 months ago

I would prefer to define it for the user, keeps everything consistent if they use multiple devices / OSs / Web.

dbrgn commented 4 months ago

Yeah, probably makes sense to define a default shortname. Apps could still offer an option to customize the shortname, if desired.

In case we want to make the field required in the API: A migration could use fullname[..4] as initial value, and then we can update the sensors in the live database manually.