Skip to content

Conversation

@Schluggi
Copy link

Table of Contents generated with DocToc

Description

I added basic support for climate (#222). This is not done yet and I need some help.

In my PR I add a new class called ClimateSubscriber to handle all the special topics needed for a climate entity. I'm pretty sure this not the supposed way to do this. Moreover there is a lot of code duplication in ClimateSubscriber and Subscriber. climate is the first entity with multiple topics as far as I can see. Furthermore it would be much nicer to have different callbacks for each command. Therefore the Subscriber class must be rewritten.

Supported features so far:

  • Modes
  • Target temperature
  • Current temperature

Whats missing:

  • Actions
  • Humidity
  • Fan
  • Power
  • Presets
  • Swing
  • Temperature High/Low

License Acceptance

  • This repository is Apache version 2.0 licensed and by making this PR, I am contributing my changes to the repository under the terms of the Apache 2 license.

Type of changes

  • Add/update a helper script
  • Add/update link to an external resource like a blog post or video
  • Bug fix
  • New feature
  • Test updates
  • Text cleanups/updates
  • New release to PyPi

Checklist

  • I have read the CONTRIBUTING document.
  • All new and existing tests pass.
  • Any scripts added use #!/usr/bin/env interpreter instead of potentially platform-specific direct paths (#!/bin/sh is an allowed exception)
  • Scripts added/updated in this PR are all marked executable.
  • Scripts added/updated in this PR do not have a language file extension unless they are meant to be sourced and not run standalone. No one should have to know if a script was written in bash, python, ruby or whatever. Not including file extensions makes it easier to rewrite the script in another language later without having to change every reference to the previous version.
  • I have confirmed that any links added or updated in my PR are valid.

@Schluggi
Copy link
Author

@unixorn could you give a hint, how to handle it?

@kratz00 kratz00 self-assigned this Jul 16, 2025
@kratz00
Copy link
Collaborator

kratz00 commented Jul 16, 2025

@Schluggi Thanks for your PR, I will have a look.

@kratz00
Copy link
Collaborator

kratz00 commented Jul 30, 2025

How about?

  • class Subscriber: replace command_callback with a dictionary (key: name of command topic, value: tuple(topic name, callback))

This class can then be used to create something like SimpleSubscriber which only covers the classical command_topic or something more complex like your ClimateSubscriber class. If this makes sense to you, I can create a feature branch with the proposed changes.

@Schluggi
Copy link
Author

Sure. Sounds great.

@Schluggi
Copy link
Author

Schluggi commented Aug 3, 2025

@kratz00
Please let me know, when it is ready.

PS: The DSO check is false positive I think: e4be520 and e3fe2bf are shown as verified in github.

@kratz00
Copy link
Collaborator

kratz00 commented Aug 3, 2025

@Schluggi will do

DSO is correct, both mentioned commits are lacking the Signed-off-by: Schluggi [email protected] compared to your other commits.

Schluggi and others added 7 commits August 3, 2025 17:59
add support for climate

Signed-off-by: Schluggi <[email protected]>

� This is the commit message unixorn#3:

add support for climate

Signed-off-by: Schluggi <[email protected]>

� This is the commit message unixorn#4:

add support for climate

Signed-off-by: Schluggi <[email protected]>

add support for climate

Signed-off-by: Schluggi <[email protected]>

fix pytest
Signed-off-by: Steffen Pankratz <[email protected]>

Signed-off-by: Schluggi <[email protected]>
Signed-off-by: Steffen Pankratz <[email protected]>

Signed-off-by: Schluggi <[email protected]>

fix README

Signed-off-by: Schluggi <[email protected]>

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Signed-off-by: Schluggi <[email protected]>
Ask for contributor mastodon account so we can credit them properly in
release announcements. Also ask if there's a different way they'd prefer
to be credited.

Signed-off-by: Joe Block <[email protected]>
Signed-off-by: Schluggi <[email protected]>
Signed-off-by: Steffen Pankratz <[email protected]>

Signed-off-by: Schluggi <[email protected]>
Signed-off-by: Steffen Pankratz <[email protected]>

Signed-off-by: Schluggi <[email protected]>
Signed-off-by: Steffen Pankratz <[email protected]>

Signed-off-by: Schluggi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants