-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a lookup table to the StepperRotator to see if that helps eliminate drift.
- Loading branch information
1 parent
f9861e3
commit 95ed622
Showing
9 changed files
with
246 additions
and
117 deletions.
There are no files selected for viewing
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
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
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
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
26 changes: 26 additions & 0 deletions
26
src/main/kotlin/crackers/kobots/mqtt/homeassistant/KobotTextEntity.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package crackers.kobots.mqtt.homeassistant | ||
|
||
import java.util.concurrent.atomic.AtomicReference | ||
|
||
/** | ||
* Handles simple text messages. | ||
*/ | ||
class KobotTextEntity( | ||
val textHandler: (String) -> Unit, | ||
uniqueId: String, | ||
name: String, | ||
deviceIdentifier: DeviceIdentifier | ||
) : CommandEntity(uniqueId, name, deviceIdentifier) { | ||
|
||
override val component = "text" | ||
override val icon = "mdi:text" | ||
|
||
private val currentText = AtomicReference("") | ||
|
||
override fun currentState() = currentText.get() | ||
|
||
override fun handleCommand(payload: String) { | ||
textHandler(payload) | ||
currentText.set(payload) | ||
} | ||
} |
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
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
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
Oops, something went wrong.