Created
June 19, 2020 19:51
-
-
Save sasssass/0e5f4bdb06f16d3f4fb85ee324386d5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ElectricMotor : PropertyChangeListener { | |
var isOn = true | |
override fun propertyChange(evt: PropertyChangeEvent?) { | |
if(evt?.propertyName.equals("temperature")){ | |
val temperature = evt?.newValue as Int | |
isOn = temperature > 80 | |
Log.d("MyLog","isOn : {$isOn}") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment