ha-hpprinter icon indicating copy to clipboard operation
ha-hpprinter copied to clipboard

Error: string indices must be integers, Line: 222

Open AbeltjeNL opened this issue 1 year ago • 9 comments

Hi there,

First of all, thanks for this custom component! Been using it for two days now and it works like a charm. On the down side, my logs ar getting a bit spammed with error messages like:

Logger: custom_components.hpprinter.api.HPPrinterAPI
Source: custom_components/hpprinter/api/HPPrinterAPI.py:100
Integration: HP Printer ([documentation](https://github.com/elad-bar/ha-hpprinter), [issues](https://github.com/elad-bar/ha-hpprinter/issues))
First occurred: 11:18:43 (40 occurrences)
Last logged: 11:57:43

Failed to extract from array AlertDetailsMarkerColor of ['Black', 'Magenta', 'Yellow', 'Cyan'], Error: string indices must be integers, Line: 222

System specs: Home Assistant 2023.4.6: 2023.4.6 Supervisor: 2023.04.1 Operating System 10.1 Frontend-versie: 20230411.1 - latest Printer: HP Color LaserJet Pro MFP M177fw

AbeltjeNL avatar May 04 '23 10:05 AbeltjeNL

Same printer, exact same problem. Here is a dump of the ProductStatusDyn.xml:

<!--
 THIS DATA SUBJECT TO DISCLAIMER(S) INCLUDED WITH THE PRODUCT OF ORIGIN. 
-->
<psdyn:ProductStatusDyn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dd="http://www.hp.com/schemas/imaging/con/dictionaries/1.0/" xmlns:ad="http://www.hp.com/schemas/imaging/con/ledm/alertdetails/2007/10/31" xmlns:pscat="http://www.hp.com/schemas/imaging/con/ledm/productstatuscategories/2007/10/31" xmlns:locid="http://www.hp.com/schemas/imaging/con/ledm/localizationids/2007/10/31" xmlns:psdyn="http://www.hp.com/schemas/imaging/con/ledm/productstatusdyn/2007/10/31" xsi:schemaLocation="http://www.hp.com/schemas/imaging/con/dictionaries/1.0/ ../../schemas/dd/DataDictionaryMasterLEDM.xsd http://www.hp.com/schemas/imaging/con/ledm/alertdetails/2007/10/31 ../../schemas/AlertDetails.xsd http://www.hp.com/schemas/imaging/con/ledm/productstatuscategories/2007/10/31 ../../schemas/ProductStatusCategories.xsd http://www.hp.com/schemas/imaging/con/ledm/localizationids/2007/10/31 ../../schemas/LocalizationIds.xsd http://www.hp.com/schemas/imaging/con/ledm/productstatusdyn/2007/10/31 ../../schemas/ProductStatusDyn.xsd">
<dd:Version>
<dd:Revision>216</dd:Revision>
</dd:Version>
<psdyn:Status>
<pscat:StatusCategory>inPowerSave</pscat:StatusCategory>
</psdyn:Status>
<psdyn:AlertTable>
<dd:ModificationNumber>17</dd:ModificationNumber>
<psdyn:Alert>
<ad:ProductStatusAlertID>genuineHP</ad:ProductStatusAlertID>
<dd:SequenceNumber>12</dd:SequenceNumber>
<ad:Severity>Info</ad:Severity>
<ad:AlertDetails>
<ad:AlertDetailsMarkerColor>Black</ad:AlertDetailsMarkerColor>
<ad:AlertDetailsMarkerColor>Magenta</ad:AlertDetailsMarkerColor>
<ad:AlertDetailsMarkerColor>Yellow</ad:AlertDetailsMarkerColor>
<ad:AlertDetailsMarkerColor>Cyan</ad:AlertDetailsMarkerColor>
<ad:AlertDetailsConsumableTypeEnum>toner</ad:AlertDetailsConsumableTypeEnum>
<ad:AlertDetailsUserAction>acknowledgeConsumableState</ad:AlertDetailsUserAction>
</ad:AlertDetails>
<dd:ResourceURI>/DevMgmt/ConsumableConfigDyn.xml</dd:ResourceURI>
<dd:ResourceType>ledm:hpLedmConsumableConfigDyn</dd:ResourceType>
</psdyn:Alert>
</psdyn:AlertTable>
</psdyn:ProductStatusDyn>

ravens avatar May 14 '23 07:05 ravens

@elad-bar, is this project still active?

AbeltjeNL avatar Jun 24 '23 19:06 AbeltjeNL

Yes, but don't have time too much, will try to get to it later this week

elad-bar avatar Jun 25 '23 04:06 elad-bar

Yes, but don't have time too much, will try to get to it later this week

Hi there,

@elad-bar Did you manage to find some time to look at this? :) CC does still work but is also spamming the logs.

AbeltjeNL avatar Aug 12 '23 22:08 AbeltjeNL

Is it still relevant?

Thanks

elad-bar avatar Jan 02 '24 14:01 elad-bar

Is it still relevant?

Thanks

With the older version yes, newer version going to test this week when HA releases it's new version (not testing beta). Did you fix anything to address this problem in your new version?

AbeltjeNL avatar Jan 02 '24 14:01 AbeltjeNL

Last release that was for bug fixing was in end of May (1.0.8), I'm working on v2 for the integration, I'm trying to understand which issues are relevant

elad-bar avatar Jan 02 '24 14:01 elad-bar

Last release that was for bug fixing was in end of May (1.0.8),

I'm working on v2 for the integration, I'm trying to understand which issues are relevant

Alright. Will test your newest version and HA's new version tomorrow and will report back to you.

AbeltjeNL avatar Jan 02 '24 14:01 AbeltjeNL

Just installed HA Core 2024.1.0 and your latest release 1.0.12. The same error is still present:

Failed to extract from array AlertDetailsMarkerColor of ['Black', 'Magenta', 'Yellow', 'Cyan'], Error: string indices must be integers, not 'str', Line: 222

Can I provide you with detailed or debug logs?

AbeltjeNL avatar Jan 03 '24 21:01 AbeltjeNL

@elad-bar, this error is also in effect with the v2.0.0b4 release. Can you take a look? Can I provide you with extra log files?

AbeltjeNL avatar Apr 16 '24 09:04 AbeltjeNL

@AbeltjeNL can you pls provide logs for that issue from v2.0.0b9, in addition, pls provide also diagnostic file.

thanks

elad-bar avatar May 17 '24 12:05 elad-bar

is it still relevant with v2?

thanks

elad-bar avatar Jun 15 '24 11:06 elad-bar

is it still relevant with v2?

thanks

This problem is fixed in v2. Keep up the good work!

AbeltjeNL avatar Jun 15 '24 11:06 AbeltjeNL