Skip to main content

hwhpykit

Main function

  • Connection
    • mqtt

Connection

Mqtt

from hwhpykit import MQTTAsyncClient, mqtt_subscribe
import asyncio

# Config MQTT Client
client = MQTTAsyncClient(broker="broker.hivemq.com", port=1883, client_id="my_client")
client.start()


@mqtt_subscribe("topic/test1")
async def handle_message_1(message: str):
    print(f"Received message from topic 1: {message}")

@mqtt_subscribe("topic/test2")
async def handle_message_2(message: str):
    print(f"Received message from topic 2: {message}")

async def send_messages():
    while True:
        await asyncio.sleep(2)
        client.publish("topic/test1", "Hello from topic 1!")
        client.publish("topic/test2", "Hello from topic 2!")

async def main():
    await asyncio.gather(
        send_messages(),
        asyncio.sleep(3600) 
    )

if __name__ == '__main__':
    asyncio.run(main())

Metadata

Release files for hwhpykit 1.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hwhpykit 1.1.8
File Size Uploaded Provenance Actions
hwhpykit-1.1.8.tar.gz 3.0 kB Without provenance Details for hwhpykit-1.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hwhpykit 1.1.8
File Interpreter ABI Platform Actions
hwhpykit-1.1.8-py3-none-any.whl Python 3 none any Details for hwhpykit-1.1.8-py3-none-any.whl

Total release size: 6.6 kB

Release files / hwhpykit-1.1.8.tar.gz

Download URL hwhpykit-1.1.8.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0b756a35831d68212d06399101ce848864d0de6fc6be6fb6ea48315247714f6a
BLAKE2b-256 checksum
How to use checksums
2b47321f996a09360a473fb989a8ea6e97e76b5cfbc2175fd6b873a42f8a65f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.10

Release files / hwhpykit-1.1.8-py3-none-any.whl

Download URL hwhpykit-1.1.8-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb13256f42840b923c69cc1bdcc5cb07cd7d2f4eeed4ba11dca6b882b35cf90a
BLAKE2b-256 checksum
How to use checksums
55872b6a3da800c00283ced1a5d627debf3b4614e35247f442f51b09d3b25af6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.10

Security for hwhpykit 1.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page