וַיֵּ֗לֶךְ וַֽיַּעֲבֹד֙ אֱלֹהִ֣ים אֲחֵרִ֔ים וַיִּשְׁתַּ֖חוּ לָהֶ֑ם וְלַשֶּׁ֣מֶשׁ ׀ א֣וֹ לַיָּרֵ֗חַ א֛וֹ לְכָל־צְבָ֥א הַשָּׁמַ֖יִם אֲשֶׁ֥ר לֹא־צִוִּֽיתִי׃
lalu ia pergi dan beribadah kepada allah lain serta sujud menyembah kepada mereka, dan kepada matahari, atau bulan, atau segenap tentara langit, hal yang tidak Kuperintahkan,
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;