<https://github.com/Nilhcem/i2cfun-androidthings/b...
# android
n
https://github.com/Nilhcem/i2cfun-androidthings/blob/master/app/src/main/java/com/nilhcem/androidthings/i2cfun/device/components/ArduinoFanI2C.kt Hi, What modifications would I have to make in the code above, to make the result of this line: companion object { fun fromValue (i2cValue: Int) = Speed.values (). firstOrNull {it.i2cValue == i2cValue}?: MEDIUM which in the case is static (MEDIUM) in dynamic, ie, I want to get this value from a firebase field
stackoverflow 1
d
What exactly do you want the function to do?
n
Hello, thanks for answering, I have this project below that was forkado of said project
in this line: companion object { fun fromValue(motorneuber: Byte) = MotorNumber.values().firstOrNull { it.motorneuber == motorneuber } ?: Two
the Two OR One, depending on the case, will come from a firebase field
the field will be of type string and if in such field is the word One turns One if it has Two turns Two
r
This isn't really a Kotlin specific question. You should read the Firebase remote config documentation ... There are many sources online that may help
❤️ 1
2
n
Lol
🤦‍♀️ 3
r
I think research from your end is appreciated before asking vague questions here. This is clearly related to firebase and if you look around, you’ll see that Firebase is well documented and has really good samples. Asking for opinions on using firestore vs a realtime database vs remote config would have been well received here. Believe me learning how to code is daunting but please go through the docs first.
n
I am not emptying vacant questions, I explained well what I want above
You do not know me (about programming experience) so you can not omit any opinions about me
d
@neuber I’ve seen your question very often here. Mostly very trivial questions showing that you didn’t spend any time to learn basics of programming and Kotlin. Start first with some programming courses or lessons and then read Kotlin/Android documentation. This is is not a place for it.
1
e
As this is the Kotlin Slack, I would really love to see Kotlin-specific Android questions in this channel. Your question, although containing snippets written in Kotlin, has nothing to do with the language. StackOverflow is the place for questions like this. Please avoid asking off-topic questions here.
11