MatMaul / pynetgear

Python library to control Netgear wireless routers through the SOAP-api.
MIT License
236 stars 75 forks source link

Support getting satellite information from Orbi systems #135

Closed natekspencer closed 1 year ago

natekspencer commented 1 year ago

Orbi satellite information does not get included via the attached devices calls, but rather has a separate GetAllSatellites method. This PR is mostly to get in on the radar and see how you would like to have it implemented in code.

Here is the response from my system when it is called:

<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope
  xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
    soap-env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    >
  <soap-env:Body>
    <m:GetAllSatellitesResponse
      xmlns:m="urn:NETGEAR-ROUTER:service:DeviceInfo:1">
      <CurrentSatellites>
        <satellite>
          <IP>10.69.0.3</IP>
          <MAC>34:98:B5:xx:xx:xx</MAC>
          <DeviceName>Satellite 2</DeviceName>
          <DeviceNameUserSet>true</DeviceNameUserSet>
          <ModelName>RBSE960</ModelName>
          <SerialNumber>redacted</SerialNumber>
          <SignalStrength>38</SignalStrength>
          <FWVersion>V6.3.7.10</FWVersion>
          <Hop>1</Hop>
          <ParentMac>34:98:B5:xx:xx:xx</ParentMac>
          <IsLightingLEDSupported>0</IsLightingLEDSupported>
          <LightingLEDOnOffStatus>0</LightingLEDOnOffStatus>
          <LightingLEDBrightnessStatus>0</LightingLEDBrightnessStatus>
          <AvsSupport>na</AvsSupport>
          <BHConnType>5GHz</BHConnType>
          <BHConnStatus>2</BHConnStatus>
        </satellite>
        <satellite>
          <IP>10.69.0.2</IP>
          <MAC>34:98:B5:xx:xx:xx</MAC>
          <DeviceName>Satellite 1</DeviceName>
          <DeviceNameUserSet>true</DeviceNameUserSet>
          <ModelName>RBSE960</ModelName>
          <SerialNumber>redacted</SerialNumber>
          <SignalStrength>40</SignalStrength>
          <FWVersion>V6.3.7.10</FWVersion>
          <Hop>1</Hop>
          <ParentMac>34:98:B5:xx:xx:xx</ParentMac>
          <IsLightingLEDSupported>0</IsLightingLEDSupported>
          <LightingLEDOnOffStatus>0</LightingLEDOnOffStatus>
          <LightingLEDBrightnessStatus>0</LightingLEDBrightnessStatus>
          <AvsSupport>na</AvsSupport>
          <BHConnType>5GHz</BHConnType>
          <BHConnStatus>2</BHConnStatus>
        </satellite>
      </CurrentSatellites>
    </m:GetAllSatellitesResponse>
    <ResponseCode>000</ResponseCode>
  </soap-env:Body>
</soap-env:Envelope>
starkillerOG commented 1 year ago

@natekspencer thanks a lot for this PR! I have simplified it a bit by using the self._get() method instead of the self._make_request() method. I have merged it in with this commit: https://github.com/MatMaul/pynetgear/commit/3b9cfb19013ca14526bf06a2b88640ad623ec30e

Are you using HomeAssistant or this libary as a stand allone module? What information from this call would you like to see added to HomeAssistant? Maybe the SignalStrength and BHConnType as sensors?

natekspencer commented 1 year ago

Awesome, that'll be great! I only use this with HomeAssistant and primarily wanted to be able to see the satellites and information about them (firmware, model). I think SignalStrength and BHConnType are useful and once we understand what BHConnStatus means, I think that would be useful as well.