Giter Club home page Giter Club logo

khome's Issues

Feature Discussion: Kotlin Multiplatform

I'm interested in using Khome in a mobile app that runs on both iOS and Android using Kotlin Multiplatform. Would the collaborators (y'all) be interested in making this project multiplatform compatible? Notably this would mean swapping any incompatible dependencies with compatible versions, like KotlinLogging -> Kermit and Gson -> kotlinx.serialization. I'm happy to help with the work, but can also easily maintain a fork if this isn't something wanted in the main repo.

Additionally, if there are any changes to make Khome usable as a library in a mobile app then I'd want to make those changes as well (in case that affects the fork vs. no-fork decision).

Very cool project, and thanks!

Koin cant find HassApiClient

Exception in thread "main" org.koin.core.error.NoBeanDefFoundException: No definition found for 'khome.communicating.HassApiClient' has been found. Check your module definitions.
	at org.koin.core.scope.Scope.findDefinition(Scope.kt:170)
	at org.koin.core.scope.Scope.resolveInstance(Scope.kt:164)
	at org.koin.core.scope.Scope.get(Scope.kt:128)
	at khome.KhomeApplicationImpl$special$$inlined$inject$default$2.invoke(Scope.kt:327)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
	at khome.KhomeApplicationImpl.getHassApi(KhomeApplicationImpl.kt:62)
	at khome.KhomeApplicationImpl.callService(KhomeApplicationImpl.kt:139)
	at khome.KHmoeMainKt.main(KHmoeMain.kt:25)
	at khome.KHmoeMainKt.main(KHmoeMain.kt)
fun main() {
    KHOME.notifyMobileApp(Device.from("mmy_phone")) {
        title = "INTRUDER ALARM"
        message = "Garden shed door opened"
    }
    KHOME.runBlocking()
}

[Feature Request] Hass.io (Operating System) Add-on + Usability concerns

First of all, I'd like to say thank you and well done!
I'm a great Kotlin fan myself and while I was using AppDaemon for my automations, all this loosely typed nonsense is driving me nuts. I'm very interested to be able to automate parts of my home using a proper programming language like Kotlin.
I am wondering however how you're currently running khome to test it. I understand it can be run from any device that can run Java, so running it from hass.io shouldn't be a problem. However, hass.io does however require an add-on (because of docker and such) to be able to run it, turn it on/off and update it eventually (like AppDaemon).
So that's my humble request for now, other than that, keep up the terrific work :D

Edit: I am a bit curious why it is necessary to create all these classes for simple actions like turning on a certain light. I mean, shouldn't

callService(TurnOn(Light("wall_lamp")))
// Or even
Light("wall_lamp").turnOn()

be a lot easier and lower the learning curve from the python people we're trying to convince to switch?
I assume it's necessary for that Koin stuff, but it does increase the difficulty of using it a lot I think.
Anyways I'll have to play with it to be sure of course.

Edit2: After playing around a bit, I do think that using Koin to make the code more DSL like is hurting the actual usability of the library. To turn off, say 10 light, instead of just creating Light objects from a list of entities and turning those off with a single forloop, now I'd have to create a class for any light in the house, plus for each light a TurnOffLight and TurnOnLight class, I'd have to register them all as beans and then I'd have to callService<>() manually for each light!
Plus, when I add a new light, I'd have to do it all again!
I think some things of your library are great and the amount of work you've put into it is clear, but I think it wouldn't hurt to pursue a simpler approach, like AppDaemon. Abstract away from the service calls and make entities instances. At least that's how I would do it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.