<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>abyssluke</author_name>
  <author_url>https://blog.hatena.ne.jp/abyssluke/</author_url>
  <blog_title>以下省略!</blog_title>
  <blog_url>https://abyssluke.hatenablog.com/</blog_url>
  <categories>
    <anon>雑記その他</anon>
    <anon>一行ブログ</anon>
  </categories>
  <description>SwitchBotにはAPIが用意されており、SwitchBotアプリにログインした状態でプロフィール→設定→アプリバージョンを10回タップすると開発者向けオプションが表示され、APIに必要なトークンを取得できるようになる。というわけでAPIをPythonで試しに叩いてみた図(記事画像)。Hub Mini経由でつながっている温湿度計のデバイスID(MACアドレス)を指定して温度・湿度を取得している。なおAPIドキュメントのPythonの項目には認証用ヘッダーの作り方しか書かれていないため別途requestsなどをimportしてAPIを叩くコードを書く必要はある。やろうと思えばDiscordで…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fabyssluke.hatenablog.com%2Fentry%2F2023%2F01%2F29%2F194515&quot; title=&quot;なんとなくSwitchBotのAPIを叩いて温度・湿度を取得してみるテスト - 以下省略!&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/a/abyssluke/20230129/20230129183044.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-01-29 19:45:15</published>
  <title>なんとなくSwitchBotのAPIを叩いて温度・湿度を取得してみるテスト</title>
  <type>rich</type>
  <url>https://abyssluke.hatenablog.com/entry/2023/01/29/194515</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
