Skip to content

Instantly share code, notes, and snippets.

@sasssass
Created June 19, 2020 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sasssass/0e5f4bdb06f16d3f4fb85ee324386d5f to your computer and use it in GitHub Desktop.
Save sasssass/0e5f4bdb06f16d3f4fb85ee324386d5f to your computer and use it in GitHub Desktop.
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