craftbeerpi / craftbeerpi4

GNU General Public License v3.0
133 stars 83 forks source link

ConfigType.SENSOR does not show a selection of all sensors in settings #79

Closed JamFfm closed 2 years ago

JamFfm commented 3 years ago

ConfigType.SENSOR does not show a selection of all sensors in settings-menue.

If I use ConfigType.KETTLE all the kettles can be selected as it should be. It just doesn't work with SENSOR.

I use the following code. Is there anything I missed? Maybe it is a bug?

from cbpi.api.config import ConfigType

    async def set_lcd_sensortype_for_sensor_mode1(self):     
        sensor_type = self.cbpi.config.get('LCD_Display_Sensortype', None)
        if sensor_type is None:
            try:
                await self.cbpi.config.add('LCD_Display_Sensortype', '', ConfigType.SENSOR,
                                           'select the type of sensor')
                logger.info("LCD_Display_Sensortype added")
                sensor_type = self.cbpi.config.get('LCD_Display_Sensortype', None)
            except Exception as e:
                logger.warning(e)
            pass
        pass
        return sensor_type
avollkopf commented 3 years ago

Hi, this is related to code in the cbpi-ui.

I alreay created a pull request: https://github.com/Manuel83/craftbeerpi4-ui/pull/4

JamFfm commented 3 years ago

Using avollkopf's craftbeer4-ui ConfigType.sensor is working and gives back the sensor ID of selected sensor as ist should.

avollkopf commented 2 years ago

Solved as forks mentioned above have been merged