syssi / esphome-dps

ESPHome component to monitor and control the RDTech DPS series
Apache License 2.0
14 stars 4 forks source link

Set current resolution based of DSP model number #18

Closed antfurn closed 9 months ago

antfurn commented 9 months ago

Using both a DPS3005 and DSH5005 with the same ESP32 caused me issues with setting/reading the current because of the different resolution. So I've added automatically setting the resolution based on the DPS model number it returns.

Also added a picture of the pinout for the serial connector to the readme

{This is a great custom component for ESPHome, thanks very much to creating it}

syssi commented 9 months ago

I've refactored your code a bit. The device model based auto-detection is the default now and is called current_resolution: AUTO. It can be overridden if another value (LOW,HGIH`) is used. Could you give it a try?

antfurn commented 9 months ago

Hi - sure I'll try get to test it tonight. Your refactoring looks good, I had wondered about doing something like that too 👍

antfurn commented 9 months ago

Gave this a brief test tonight and working fine - thanks.