title: '0.47: Python 脚本, Sesame Smart 门锁, Gitter, Onvif 摄像头' description: '<a href=''/home-assistant/integrations/版本/0.47''<img src=''/home-assistant/images/blog/2017-06-0.47/components.png'' style=''border: 0;box-shadow: none;''</a。' 已经突破 700 个集成!

0.47: Python 脚本, Sesame Smart 门锁, Gitter, Onvif 摄像头

这次发布带来了海量新内容!谁会不喜欢新东西呢?在这个版本中,Home Assistant 的集成数量突破了 700 个。截至今天,我们已经 1369 天大了,这意味着大约每两天就会新增一个集成!

Python 脚本

The biggest change is a new type of 脚本 component: Python 脚本. This new component will allow you to write 脚本 to manipulate Home Assistant: call 服务, set 状态 and fire events. Each Python 脚本 is made available as a 服务. Head over to the docs to see how to get started.

更新检查器

更新检查器新增了一个主动选择加入的选项,让我们了解你正在使用哪些组件。这样我们就能把开发精力更集中地投入到受欢迎的组件上。

updater:
  include_used_components: true

顺便提醒一下,我们绝不会以可识别个人身份的方式分享收集到的数据。不过我们计划很快公开汇总数据,其中会包括总用户数量,以及大家运行 Home Assistant 所使用的硬件/软件平台。

Z-Wave

Z-Wave is also getting a big 更新 in this 发布. The confusing entity_ids will be on their way out. There is a zwave 博客 post that gives more detail, but the 升级 steps will be as follows:

  1. Run Home Assistant as normal and the old IDs will still be used.
  2. The new 实体 IDs will be shown in the more-info dialog for each 实体. Check to make sure none of them will have conflicts once the new names are applied.
  3. Rename 实体 using the ui 卡片 as described in the 博客 post to avoid conflicts. 重启 Home Assistant to observe the changes.
  4. 更新 all places mentioning IDs (groups, 自动化, customization, etc.) in 配置.yaml.
  5. Add new_entity_ids: true to your zwave config.
  6. 重启 Home Assistant to run with new IDs.
  7. The old 实体 IDs will be available in the more info dialog to trace down any remaining 错误.

Python 3.6 猴子补丁

一些人发现,在 Python 3.6 下运行 Home Assistant 可能会导致段错误。这似乎与我们发布基于 asyncio 的核心时遇到的早期段错误问题有关。我们原以为这些问题会在 Python bug 26617 修复后消失。虽然与旧问题相比,相关报告已经少了很多,但仍然有用户遇到这个问题gdb 堆栈跟踪指向 PyObject_GC_Del())。

从 Python 3.6 开始,Task 和 Future 类被迁移到了 C 实现。这确实带来了不错的性能提升,但也让我们无法再通过 monkey patch Task 类来规避段错误。Ben Bangert 想出了另一个 monkey patch,阻止 Python 3.6 使用 C 类,转而回退到 Python 版本。这样我们就能再次应用原先的 monkey patch。

从 0.47 版本开始,这两个 monkey patch 会默认启用,以避免用户遭遇段错误。代价是无法享受 Python 3.6 引入的全部优化。

如果你想在不启用 monkey patch 的情况下运行 Home Assistant,可以使用 HASS_NO_MONKEY=1 hass 启动。我们会继续调查这个问题,并尝试在未来的 Python 版本中彻底修复它。

发布 0.47.1 - June 21

新平台

如果你需要帮助……

欢迎使用我们非常活跃的 论坛,或加入 聊天频道 与我们交流。虽然发布说明也开放评论,但我们更推荐使用前面的沟通渠道。谢谢。

反馈问题

如果你遇到了这个版本引入的问题,请前往我们的 issue tracker 提交反馈,并确保填写 issue 模板中的所有字段。

不向后兼容的变更

image_processing:
  - platform: opencv
    name: OpenCV
    source:
      - entity_id: camera.front_door
    classifier:
      faces:
        file: /path/to/classifier
        name: Husband
        neighbors: 4
        min_size: (40, 40)
        scale: 1.1
lutron:
  host: IP_ADDRESS
  username: lutron
  password: integration
mailgun:
  domain: !secret mailgun_domain
  api_key: !secret mailgun_api_key
  sandbox: false

notify:
  - name: mailgun
    platform: mailgun
    recipient: !secret mailgun_recipient
  • Z-Wave node and 场景 activated 触发器 events now use the full 实体 ID (@armills - #7786) (zwave docs) (breaking change)
automation:
  - alias: "Button 1"
    trigger:
      platform: event
      event_type: zwave.scene_activated
      event_data:
        entity_id: living_room_remote_13
        scene_id: 1
automation:
  - alias: "Event 1"
    trigger:
      platform: event
      event_type: zwave.node_event
      event_data:
        entity_id: zwave.living_room_remote_13
        basic_level: 1
  • LIFX: add multiple modes to pulse effect. The lifx_effect_breathe call has been deprecated. Use lifx_effect_pulse with the new mode: breathe 属性 instead. (@amelchio - #8016) (灯光.lifx docs) (breaking change)
  • Use standard entity_ids for zwave 实体. This also introduces a small API breakage, where EVENT_SCENE_ACTIVATED and EVENT_NODE_EVENT will no longer supply an object_id. They will now be tied to the node entity_id. (@armills - #7786) (zwave docs) (灯光.zwave docs) (breaking change)
  • Fix 属性 实体. Home Assistant will no longer filter out 实体 that are 'falsey'. So you might see more 实体 属性 show up. (@pvizeli - #8066) (breaking change)

全部变更