azure-iot-hub python 包的替代品

问题描述 投票:0回答:1

azure-iot-hub python 软件包在过去 2 年里没有任何更新,并且依赖于已弃用的 azure-uamqp-python,该软件包无法在 Python 3.12+ 上的 Mac ARM 和 Linux ARM 等系统上构建。

那么,有什么替代方案可以替代吗?

参考: https://github.com/ansible-collections/azure/pull/1512

编辑: 目前我对此没有问题。我正在寻找替代方案,以防可能从 Ansible 集合中删除此包。

python azure azure-iot-hub pypi
1个回答
0
投票

以下步骤概述了如何使用 Azure CLI 命令设置 Azure IoT 中心和管理设备:

  • 要登录您的 Azure 帐户,请使用 Azure CLI 并执行以下命令:
az login

Enter Image Description Here

  • 创建 IoT 中心:如果您尚未创建 IoT 中心,可以使用 Azure CLI 创建一个:
az iot hub create --name <hub_name> --resource-group <resource_group_name> --sku S1

Enter Image Description Here

  • 请参阅此文档以使用 Azure CLI 创建、列出、更新和删除设备。

创建设备:

az iot hub device-identity create --hub-name <hub_name> --device-id <device_id>

Enter Image Description Here

列出设备

az iot hub device-identity list --hub-name <hub_name>

Enter Image Description Here

  • 获取设备孪生
az iot hub device-twin show --device-id <device_id> --hub-name <hub_name>

Enter Image Description Here

  • 请参阅此文档以使用 Azure CLI 获取和更新设备孪生属性。

  • 更新设备孪生

az iot hub device-twin update --device-id
                              [--add]
                              [--auth-type {key, login}]
                              [--desired]
                              [--etag]
                              [--force-string]
                              [--hub-name]
                              [--login]
                              [--remove]
                              [--resource-group]
                              [--set]
                              [--tags]

Enter Image Description Here

Enter Image Description Here

  • 请参阅此 SO 如何使用 python 运行 Azure CLI 命令
© www.soinside.com 2019 - 2024. All rights reserved.