Files
espurna/code
Max Prokhorov cae50fa544 sensor/emon: refactoring (#2213)
- Update sensor classes to support a generic way to store energy values
- Update sensor conversion code to deal with units and not magnitudes
- Add magnitude<->unit for sensors, generic way of defining used unit. Convert from sensor magnitude unit to the one used for display.
- Reset energy value based on index through external means (MQTT, HTTP)
- Rework energy timestamping, update webui with 'last saved' value

While this solves the energy conversion issues and we are finally seeing the real value, what I don't really like:
- KilowattHour and WattHour are separate enum tags, thus sort-of are different types altogether
- Conversion code in Energy object should probably use some generic 'ratio' calculation? (https://en.cppreference.com/w/cpp/numeric/ratio/ratio)
- We are still using runtime checks to do calculations and depend that sensor outputs only one specific value type.

Consider this a fix for energy display / storage and preliminary work on sensor.ino
Further sensor refactoring... soon.
2020-04-08 00:37:26 +03:00
..
2020-04-08 00:37:26 +03:00
2020-04-08 00:37:26 +03:00
2019-07-11 00:34:17 +03:00
2020-03-13 09:28:15 +03:00
2019-07-11 00:34:17 +03:00
2020-04-07 21:48:43 +03:00
2018-12-09 21:11:12 +01:00
2018-12-09 00:03:55 +03:00
2019-07-11 00:34:17 +03:00