Skip to content

Commit

Permalink
Add changes for 756cbfe
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jan 4, 2025
1 parent 8136eec commit a486643
Show file tree
Hide file tree
Showing 10 changed files with 177 additions and 156 deletions.
Binary file modified .doctrees/ecodevices_rt2.sensors.doctree
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
26 changes: 15 additions & 11 deletions _modules/ecodevices_rt2/sensors/sensor_counter.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,15 @@

<h1>Source code for ecodevices_rt2.sensors.sensor_counter</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">homeassistant.components.sensor</span> <span class="kn">import</span> <span class="n">SensorDeviceClass</span>
<span class="kn">from</span> <span class="nn">homeassistant.components.sensor</span> <span class="kn">import</span> <span class="n">SensorStateClass</span>
<span class="kn">from</span> <span class="nn">homeassistant.core</span> <span class="kn">import</span> <span class="n">HomeAssistant</span>
<span class="kn">from</span> <span class="nn">homeassistant.helpers.update_coordinator</span> <span class="kn">import</span> <span class="n">DataUpdateCoordinator</span>
<span class="kn">from</span> <span class="nn">pyecodevices_rt2</span> <span class="kn">import</span> <span class="n">Counter</span>
<span class="kn">from</span> <span class="nn">pyecodevices_rt2</span> <span class="kn">import</span> <span class="n">EcoDevicesRT2</span>

<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">Sensor_EcoDevicesRT2</span>
<span class="kn">from</span> <span class="nn">..const</span> <span class="kn">import</span> <span class="n">CONF_DEVICE_CLASS</span>
<span class="kn">from</span> <span class="nn">..const</span> <span class="kn">import</span> <span class="n">CONF_STATE_CLASS</span>


<div class="viewcode-block" id="Sensor_Counter">
Expand All @@ -97,12 +100,9 @@ <h1>Source code for ecodevices_rt2.sensors.sensor_counter</h1><div class="highli
<span class="n">device_config</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span>
<span class="n">ecort2</span><span class="p">:</span> <span class="n">EcoDevicesRT2</span><span class="p">,</span>
<span class="n">coordinator</span><span class="p">:</span> <span class="n">DataUpdateCoordinator</span><span class="p">,</span>
<span class="n">device_class</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">suffix_name</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="p">):</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span>
<span class="n">hass</span><span class="p">,</span> <span class="n">device_config</span><span class="p">,</span> <span class="n">ecort2</span><span class="p">,</span> <span class="n">coordinator</span><span class="p">,</span> <span class="n">device_class</span><span class="p">,</span> <span class="n">suffix_name</span>
<span class="p">)</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">hass</span><span class="p">,</span> <span class="n">device_config</span><span class="p">,</span> <span class="n">ecort2</span><span class="p">,</span> <span class="n">coordinator</span><span class="p">,</span> <span class="n">suffix_name</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">control</span> <span class="o">=</span> <span class="n">Counter</span><span class="p">(</span><span class="n">ecort2</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_id</span><span class="p">)</span></div>


Expand All @@ -113,19 +113,20 @@ <h1>Source code for ecodevices_rt2.sensors.sensor_counter</h1><div class="highli
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">hass</span><span class="p">:</span> <span class="n">HomeAssistant</span><span class="p">,</span>
<span class="n">device_config</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span>
<span class="n">device_config_g</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span>
<span class="n">ecort2</span><span class="p">:</span> <span class="n">EcoDevicesRT2</span><span class="p">,</span>
<span class="n">coordinator</span><span class="p">:</span> <span class="n">DataUpdateCoordinator</span><span class="p">,</span>
<span class="p">):</span>
<span class="n">device_class</span> <span class="o">=</span> <span class="n">SensorDeviceClass</span><span class="o">.</span><span class="n">ENERGY</span>
<span class="k">if</span> <span class="n">device_config</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;device_class&quot;</span><span class="p">):</span>
<span class="n">device_class</span> <span class="o">=</span> <span class="n">device_config</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;device_class&quot;</span><span class="p">)</span>
<span class="n">device_config</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</span><span class="n">device_config_g</span><span class="p">)</span>
<span class="k">if</span> <span class="n">CONF_DEVICE_CLASS</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">device_config</span><span class="p">:</span>
<span class="n">device_config</span><span class="p">[</span><span class="n">CONF_DEVICE_CLASS</span><span class="p">]</span> <span class="o">=</span> <span class="n">SensorDeviceClass</span><span class="o">.</span><span class="n">ENERGY</span>
<span class="n">device_config</span><span class="p">[</span><span class="n">CONF_STATE_CLASS</span><span class="p">]</span> <span class="o">=</span> <span class="n">SensorStateClass</span><span class="o">.</span><span class="n">TOTAL_INCREASING</span>

<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span>
<span class="n">hass</span><span class="p">,</span>
<span class="n">device_config</span><span class="p">,</span>
<span class="n">ecort2</span><span class="p">,</span>
<span class="n">coordinator</span><span class="p">,</span>
<span class="n">device_class</span><span class="p">,</span>
<span class="s2">&quot;Index&quot;</span><span class="p">,</span>
<span class="p">)</span>

Expand All @@ -145,16 +146,19 @@ <h1>Source code for ecodevices_rt2.sensors.sensor_counter</h1><div class="highli
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">hass</span><span class="p">:</span> <span class="n">HomeAssistant</span><span class="p">,</span>
<span class="n">device_config</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span>
<span class="n">device_config_g</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span>
<span class="n">ecort2</span><span class="p">:</span> <span class="n">EcoDevicesRT2</span><span class="p">,</span>
<span class="n">coordinator</span><span class="p">:</span> <span class="n">DataUpdateCoordinator</span><span class="p">,</span>
<span class="p">):</span>
<span class="n">device_config</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</span><span class="n">device_config_g</span><span class="p">)</span>
<span class="n">device_config</span><span class="p">[</span><span class="n">CONF_DEVICE_CLASS</span><span class="p">]</span> <span class="o">=</span> <span class="n">SensorDeviceClass</span><span class="o">.</span><span class="n">MONETARY</span>
<span class="n">device_config</span><span class="p">[</span><span class="n">CONF_STATE_CLASS</span><span class="p">]</span> <span class="o">=</span> <span class="n">SensorStateClass</span><span class="o">.</span><span class="n">MEASUREMENT</span>

<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span>
<span class="n">hass</span><span class="p">,</span>
<span class="n">device_config</span><span class="p">,</span>
<span class="n">ecort2</span><span class="p">,</span>
<span class="n">coordinator</span><span class="p">,</span>
<span class="n">SensorDeviceClass</span><span class="o">.</span><span class="n">MONETARY</span><span class="p">,</span>
<span class="s2">&quot;Price&quot;</span><span class="p">,</span>
<span class="p">)</span>

Expand Down
Loading

0 comments on commit a486643

Please sign in to comment.