Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rika2Mqtt Stop working when using decimals with temperatureOffset #139

Closed
sebastienvermeille opened this issue Dec 9, 2023 · 1 comment · Fixed by #141
Closed

Rika2Mqtt Stop working when using decimals with temperatureOffset #139

sebastienvermeille opened this issue Dec 9, 2023 · 1 comment · Fixed by #141
Assignees
Labels
bug Something isn't working

Comments

@sebastienvermeille
Copy link
Owner

I discovered a nasty bug when playing with my RIKA stove.

I setted an offset for the remote temperature sensor -0.5 and this break up rika2mqtt deserialization.

Logs:

Caused by: com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was -0.5 at line 1 column 959 path $.controls.temperatureOffset
        at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:251)
        at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:241)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.readIntoField(ReflectiveTypeAdapterFactory.java:212)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:433)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:393)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.readIntoField(ReflectiveTypeAdapterFactory.java:212)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:433)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:393)
        at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:40)
        at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:27)
        at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:243)
        at retrofit2.OkHttpCall.execute(OkHttpCall.java:204)
        at dev.cookiecode.rika2mqtt.rika.firenet.RikaFirenetServiceImpl.getStatus(RikaFirenetServiceImpl.java:293)
        at dev.cookiecode.rika2mqtt.bridge.Bridge.lambda$publishToMqtt$0(Bridge.java:125)
        at java.base/java.util.ArrayList.forEach(Unknown Source)
        at dev.cookiecode.rika2mqtt.bridge.Bridge.publishToMqtt(Bridge.java:120)
        at dev.cookiecode.rika2mqtt.bridge.Bridge.init(Bridge.java:88)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMethod.invoke(InitDestroyAnnotationBeanPostProcessor.java:457)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:401)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:219)
        ... 23 common frames omitted
Caused by: java.lang.NumberFormatException: Expected an int but was -0.5 at line 1 column 959 path $.controls.temperatureOffset
        at com.google.gson.stream.JsonReader.nextInt(JsonReader.java:1218)
        at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:249)
        ... 44 common frames omitted
@sebastienvermeille sebastienvermeille self-assigned this Dec 9, 2023
@sebastienvermeille sebastienvermeille added the bug Something isn't working label Dec 9, 2023
@sebastienvermeille
Copy link
Owner Author

I will work on it in a couple of hours and provide a release as soon as I merged it.

@sebastienvermeille sebastienvermeille pinned this issue Dec 9, 2023
@sebastienvermeille sebastienvermeille linked a pull request Dec 9, 2023 that will close this issue
@sebastienvermeille sebastienvermeille unpinned this issue Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant