וַיֵּ֗לֶךְ וַֽיַּעֲבֹד֙ אֱלֹהִ֣ים אֲחֵרִ֔ים וַיִּשְׁתַּ֖חוּ לָהֶ֑ם וְלַשֶּׁ֣מֶשׁ ׀ א֣וֹ לַיָּרֵ֗חַ א֛וֹ לְכָל־צְבָ֥א הַשָּׁמַ֖יִם אֲשֶׁ֥ר לֹא־צִוִּֽיתִי׃
Que hubiere ido y servido á dioses ajenos, y se hubiere inclinado á ellos, ora al sol, ó á la luna, ó á todo el ejército del cielo, lo cual yo no he mandado;
Rashi
אשר לא צויתי [AND HATH GONE AND SERVED OTHER GODS … EITHER THE SUN, OR MOON, OR ANY OF THE HOST OF HEAVEN] WHICH I HAVE NOT COMMANDED to worship them (Megillah 9b).
Ibn Ezra
The grammatical properties of the word worshiped are discussed in my book Sefer Hayyǝsod. other gods denotes man-made idols, as opposed to
Sforno
אלוהים אחרים, independent ones, having no relation to Hashem whatsoever, but disembodied beings. ולשמש או לירח, which are physical bodies;